Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,i,j;
- stack <char> s;
- cin>>n;
- for(i=0;i<n;i++)
- {
- string a;
- cin>>a;
- for(j=0;j<a.size();j++)
- {
- s.push(a[j]);
- }
- for(j=0;j<a.size();j++)
- {
- cout<<s.top();
- s.pop();
- }
- cout<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment