带有空格字符串的字符逆序
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 string a; 6 while(getline(cin,a)){ 7 reverse(a.begin(),a.end()); 8 cout<<a<<endl; 9 } 10 return 0; 11 }
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 string a; 6 while(getline(cin,a)){ 7 reverse(a.begin(),a.end()); 8 cout<<a<<endl; 9 } 10 return 0; 11 }