1288: 字符串逆序(信息一本通)
作者:互联网
样例输入 Copy
abc!样例输出 Copy
cba
#include<bits/stdc++.h>
//如果不嫌麻烦可以用#include<iostream>#include<cstdio>#include<cstring>
using namespace std;
void putcharbyid(int n);
char str[10000];
int main() {
gets(str);
putcharbyid(0);
return 0;
}
void putcharbyid(int n) {
if(str[n]=='!') {
return;
}
putcharbyid(n+1);
cout<< str[n];
}
标签:return,int,void,putcharbyid,1288,str,字符串,include,逆序 来源: https://blog.csdn.net/intcincoutreturn/article/details/120594647