带有空格字符串的字符逆序

 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 }

 

posted @ 2018-03-02 15:19  wydxry  阅读(260)  评论(0编辑  收藏  举报
Live2D