http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1295
题意:
输入N句话,逆序输出。水
#include <iostream>
#include <string>
// #include <stdio.h>
using namespace std;
int main()
{
int nCase;
cin >>nCase;
cin.ignore();
while ( nCase-- )
{
string str;
getline(cin, str);
for ( string::reverse_iterator it=str.rbegin(); it!=str.rend(); it++ )
{
cout <<(*it);
} // end for
cout <<'\n';
} // end while
return 0;
}