简单的字符串逆序输出。
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;
}