每日一题3.26.1
字符串反转
解题思路: 题目比较简单,直接传入字符串用reverse函数实现
代码实现:
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
string str;
while (cin >> str)
{
reverse(str.begin(), str.end());
cout << str << endl;
}
system("pause");
return 0;
}
参考答案: