-->
当前位置:首页 > 题库 > 正文内容

FILL_IN_THE_BLANK_FOR_PROGRAMMING:Jmu-c-string reverse order output

Luz3年前 (2021-05-10)题库277
This problem requires the use of recursive functions to achieve reverse order output of strings. For example, input 'ABC', output 'CBA'`
```c++
#include
void reverse_ str(char *p);
int main()
{
char str[80];
gets(str);
reverse_ str(str);
return 0;
}
void reverse_ str(char *p){
char *q;
q=p;
if(@@[*p](3)){
q=p+1;
@@[ reverse_ str(q);]( 3)
@@[putchar(*p);]( 3)
}
}
```






answer:First empty: * P
The second blank: reverse_ str(q);
The third blank: putchar (* P);

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。