标签:int end name include ring line eve cout lin string
#include<iostream>
#include<string>
using namespace std;
void main()
{
int T;
while (cin>>T)
{
getchar();
for (int i = 0; i < T; i++)
{
string str;
getline(cin, str);
int end = 0,top = 0;
while (str[end] != ‘\0‘)
{
if (str[end]==‘ ‘)
{
for (int i = end-1; i >=top; i--)
{
cout << str[i];
}
top = end + 1;
}
end++;
}
if (str[end]==‘\0‘)
{
for (int i = end; i >=top-1; i--)
{
cout << str[i];
}
}
cout << endl;
}
}
}
标签:int end name include ring line eve cout lin string
原文地址:http://www.cnblogs.com/ruoh3kou/p/7105794.html