首先,我先,挖槽!!!坑啊!!!输入的一个整数,然后是再输入一空行,而不是打印一空行!!!
<span style="font-size:18px;">#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int ncase , line;
string s;
char ch;
cin>>ncase;
// cout<<endl;
while (ncase)
{
ncase--;
cin>>line;
while (line)
{
cin>>s;
cin.get(ch);
reverse(s.begin(),s.end());
cout<<s;
if (ch == '\n')
{
line--;
if(ncase || line) cout<<endl;
}
else if (ch == ' ') cout<<" ";
}
if (ncase != 0) cout<<endl;
}
return 0;
}</span>