Time Limit: 3000 MS | memory limit: 65535 kb difficulty: 2
-
Description
-
We usually like to count from left to right, but our little white students recently heard that the numbers of Germans are somewhat different from ours. They are just the opposite of ours, from right to left. Therefore, when he sees 123, he will say "321 ".
Now, a German professor is giving a lecture on ACM at Zhengzhou University. Now he hired you to serve as his assistant. He gave you some information to find the pages in the book. Now that you have found the corresponding page number, tell it in English.
To simplify our problem, you only need to return the first letter of a word. (The number 0 is read as the letter O)
Note: Each digit is read independently, so reading data from 11 to double one does not occur.
-
Input
-
The input is divided into two parts:
Part 1: an integer T (1 <= T <= 1000)
Part 2: A total of T rows, each with a number. The length of each number cannot exceed 10 characters.
-
Output
-
Each group of outputs occupies a single row, and the corresponding output returns the abbreviated Number of pages to the German professor.
-
Sample Input
-
2121234
-
Sample output
-
TOFTTO
-
#include<stdio.h>#include<string.h>int main(){int n;char s[100];char c[12]="OOTTFFSSENT";scanf("%d",&n);while(n--){scanf("%s",s);for(int i=strlen(s)-1;i>=0;i--)printf("%c",c[s[i]-'0']);printf("\n");}}