Posted on 2008-04-05 20:23
superman 阅读(720)
评论(0) 编辑 收藏 引用 所属分类:
ZOJ
1 /* Accepted 1151 C++ 00:00.84 844K */
2 #include <cstdio>
3 #include <string>
4 #include <iostream>
5
6 using namespace std;
7
8 int main()
9 {
10 int n, m;
11 string word;
12
13 cin >> n;
14 while(n--)
15 {
16 cin >> m;
17
18 while(m)
19 {
20 cin >> word;
21 for(int i = word.size() - 1; i >= 0; i--)
22 cout << word[i];
23 if(getchar() == '\n')
24 {
25 m--;
26 cout << endl;
27 }
28 else
29 cout << ' ';
30 }
31
32 if(n)
33 cout << endl;
34 }
35
36 return 0;
37 }
38