Title Description
Small c likes to write the words backwards, now give you a line of small C text, you can reverse each word and output them.
Input format
The input contains samples of several sets of test specimens. The first behavior is an integer t, which represents the number of test samples followed by a T test sample.
Each test sample occupies one line and contains multiple words. A line has a maximum of 1000 characters.
Output
For each test sample, you should output the converted text.
Sample input
3
Olleh!dlrow
I Ekil. BULCMCA
I Evol. MCA
Sample output
Hello world!
I like Acmclub.
I Love ACM.
Program p1048;
var n,i,j,k:longint;a,b:ansistring;
Begin
READLN (n);
For I:=1 to N do
Begin
Readln (a);
J:=pos (', a);
While j<>0 do
Begin
B:=copy (a,1,j-1);
For K:=length (b) Downto 1 do
Write (B[k]);
Write (");
Delete (A,1,J);
J:=pos (', a);
End
For K:=length (a) Downto 1 do
Write (A[k]);
Writeln;
End
End.