小C很喜欢倒着写单词,现在给你一行小C写的文本,你能把每个单词都反转并输出它们吗?
输入
输入包含多组测试样例。第一行为一个整数T,代表测试样例的数量,后面跟着T个测试样例。
每个测试样例占一行,包含多个单词。一行最多有1000个字符。
输出
对于每一个测试样例,你应该输出转换后的文本。
样例输入 Copy
3
olleh !dlrow
I ekil .bulcmca
I evol .mca
样例输出 Copy
hello world!
I like acmclub.
I love acm.
代码示例(自己写的,只能过平台,不完美)
//#include <algorithm>
//#include <iostream>
//using namespace std;
//#include <vector>
//#include <stack>
//#include <queue>
//#include <cmath>
//#include <string>
//#include <string.h>
//
//int main() {
// int t = 0;
//// cin >> t;
//// getchar();
// scanf("%d",&t);
// getchar();//当输入之后接着要输入字符(串)变量时,需要用getchar()吃掉上面输入之后的空格
// while(t--){
// int k = 0;
// string str;
// getline(cin,str);
// for(int i = 0; i < str.size(); i++){
// if(str[i] == ' ' ){
// for(int j = i - 1; j >= k; j--){
// cout << str[j];
// }
// cout << " ";
// k = i + 1;
// }
// }
// for(int l = str.size() - 1; l >= k; l--){
// cout << str[l];
// }
// cout << endl;
// }
// return 0;
//}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。