简单的字符串逆序输出。
AC代码:
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char str[100000];
int n;
while(cin >> n)
{
getchar();
for(int i = 0; i < n; i++)
{
gets(str);
int length = strlen(str);
for(int j = length - 1; j >= 0; j--)
cout << str[j];
cout << endl;
}
}
return 0;
}杭电ACM1321——Reverse Text~~逆序输出字符串
原文地址:http://blog.csdn.net/qq_25425023/article/details/45917801