题目链接:http://ac.jobdu.com/problem.php?pid=1055
题目分析:
简单的数组逆置,输入string字符串,使用for循环逆序输出。
源代码:
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
while (cin>>s)
{
for (int i = s.length() - 1; i >= 0; i--)
{
cout<<s[i];
}
cout<<endl;
}
}