标签:pac reverse write inpu time 模拟 strong -- 字符串
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 51495 Accepted Submission(s): 19692
#include <bits/stdc++.h> using namespace std; int main() { int n; char ch; cin>>n; getchar(); while(n--){ stack<char>s; while(true){ ch = getchar(); if(ch==‘ ‘||ch==‘\n‘||ch==EOF){ while(!s.empty()){ cout<<s.top(); s.pop(); } if(ch==‘\n‘||ch==EOF) break; cout<<" "; } else s.push(ch); } cout<<endl; } return 0; }
标签:pac reverse write inpu time 模拟 strong -- 字符串
原文地址:https://www.cnblogs.com/jingshixin/p/12236843.html