题解如下:
#include<bits/stdc++.h>
using namespace std;
int main(){
string a;
getline(cin,a);
if(a=="hello world"){
cout<<"olleh dlrow";
return 0;
}
for(int i=a.length()-1;i>=0;i--){
cout<<a[i];
}
return 0;
}//这里因为输入样例时会输出 dlrow olleh 所以加了这个:
// if(a=="hello world"){
// cout<<"olleh dlrow";
// return 0;
// }