//
//#include<bits/stdc++.h>
#include<iostream>
#include<stack>
using namespace std;
stack<char> st;
int main()
{
int n; char ch;
while( cin>>n )
{
cin.get();
while( n-- )
{
while( cin.get(ch) && ch!='\n' )
{
if( ch==' ' )
{
while( st.size() )
{ cout<<st.top(); st.pop(); }
cout<<' ';
}
else
st.push(ch);
}
while( st.size() )
{ cout<<st.top(); st.pop(); }
cout<<endl;
}
}
return 0;
}
HDU - 1062 Text Reverse_stack
猜你喜欢
转载自blog.csdn.net/qq_63173957/article/details/123930641
今日推荐
周排行