Description
Our innlab have a dog,this dog is God like~~so he said Stack is so easy, so he often said:"so easy~my mother never care about my Stack~~", then he give us a easy problem~~This problem you should output this numbers on reverse.(请您用栈写,否则会出现TLE)
Input
The input consists of several data sets. Each set begins with a line containing the number n .The next line contains n numbers.
Output
output this numbers on reverse
Sample Input
3iamdogdogiamsohappyyouareapig
Sample Output
godgodmaiyppahosmaigipaerauoy
// File Name: 抛抛弱弱的题.cpp
// Author: rudolf
// Created Time: 2013年03月12日 星期二 13时22分18秒
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<ctime>
using namespace std;
int main()
{
int t,lenth;
char a[10000];
while(~scanf("%d",&t))
{
while(t--)
{
scanf("%s",a);
getchar();
lenth=strlen(a);
while(lenth--)
printf("%c",a[lenth]);
printf("\n");
}
}
return 0;
}