自考新教材-p301_5(2)

源程序:

#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string str = "";
getline(cin, str, '\n');
reverse(str.begin(), str.end());
cout << str << endl;
system("pause");
return 1;
}

运行结果:

 

posted @ 2020-02-05 12:39  bobo哥  阅读(101)  评论(0编辑  收藏  举报