#include<iostream>
#include<string>
using namespace std;
string change(string s){
int len= s.length();
char t;
for (int i = 0, j = len - 1; i < j; i++, j--){
t = s[i];
s[i] = s[j];
s[j] = t;
}
return s;
}
void main(){
char s[100];
gets_s(s);
cout << change(s) << endl;
cout << endl;
system("pause");
}
字符逆序
最新推荐文章于 2021-01-30 03:14:51 发布