我测试了,是对的,为啥all WA?
#include<bits/stdc++.h>
using namespace std;
string s,c;
int main(){
getline(cin,s);
s+=" ";
for(int i=0;i<s.length();i++){
c="";
while(s[i]!=' ') c+=s[i++];
for(int j=c.length()-1;j>=0;j--){
cout<<c[j];
}
cout<<endl;
}
return 0;
}
萌新求助大佬!