咳咳,这个是为了赶量ios
须要注意的就是输入方式,别的也没什么难点spa
3 olleh !dlrow m'I morf .udh I ekil .mca
hello world! I'm from hdu. I like acm.
这是题意
接下来放代码
#include <iostream>
#include <cstdio>
#include <stack>
using namespace std;ip
int main(){
int n;
cin >> n;
getchar();
while(n--){
stack<char>cst;
while(1){
int ch=getchar();
if(ch==' '||ch=='\n'){
while(!cst.empty()){
cout << cst.top();
cst.pop();
}
if(ch==' ')cout << ' ';
else break;
}
else cst.push(ch);
}
cout << endl;
}
return 0;
}ci
OKget