36-Language Introduction-36-count

Source: Internet
Author: User

Title address:? http://acm.nyist.net/JudgeOnline/problem.php?pid=198? Description
we usually count from left to right number, but our little white classmate recently heard that the Germans count and we are somewhat different, they happen to be opposite to us, is from right to left number. So when he saw123will say"321".
Now there is a German professor at the University of Zhengzhou onACM's lectures. Now he hires you to serve as his assistant, and he gives you some information to get you to find the pages of the information in the book. Now that you have found the corresponding page number, you need to tell him the page number in English.
to simplify our problem, you only need to return the uppercase initials of the word. (Number0read into lettersO)
Note: Each digit is read separately and therefore does not appear Oneread asDouble Onethe situation.

input
The input is divided into two parts:
First part: an integerT (1<=t<=1000)
Part II: AltogetherTline, one number per action. The length of each number does not exceedTenbit.
Output
each set of outputs has a separate line, and the output corresponds to the abbreviation for the page number returned to the German professor.
Sample Input
2
12
1234
Sample Output
toFtto?? Code:#include <stdio.h>

//working with Data
Static void Handlerdata (Char *arrdir,int inputnumber);

int Main ()
{
??? Char arrdir[] = {' O ',' O ',' T ',' T ',' F ',' F ',' S ',' S ',' E ',' N '};
???
??? int Readlen = 0;
??? scanf("%d", &readlen);
??? GetChar();
???
??? while (readlen>0)
??? {
??????? int Inputnumber = 0;
??????? scanf("%d", &inputnumber);
??????? GetChar();
???????
??????? Handlerdata(Arrdir,inputnumber);
???????
??????? --readlen;
??? }
???
??? return 0;
}

//working with Data
Static void Handlerdata (Char *arrdir,int Inputnumber)
{
??? if (Inputnumber = = 0)
??? {
??????? printf("o\n");
??????? return;
??? }
???
??? while (Inputnumber > 0)
??? {
??????? int tmpindex = inputnumber% Ten;
??????? printf("%c", Arrdir[tmpindex]);
??????? Inputnumber = Inputnumber/ Ten;
??? }
??? printf("\ n");
}
?? Recommended program:?
#include <cstdio>
Char str[]= "oottffssent";
void Show (int t)
{
???? if (t) {putchar (* (STR+T%10)); show (T/10);}
}
int main ()
{
???? int n,t;
??????? scanf ("%d", &t);
???? while (t--)
???? {
????????? scanf ("%d", &n);
????????? Show (n);p UTS ("");
???? }
} ? ? ? ? ? ? ? ?

36-Language Introduction-36-count

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.