如题所述
#includeusing namespace std;void rev(char s[]){char *p,*q,c; for(p=s;*p;p++); for(q=s,--p;q<p;) {c=*p;*p--=*q;*q++=c;}}int main(){ char s[100]; cin.getline(s,100); rev(s); cout<<s<<endl; return 0;}