Enter an integer that prints the phonetic alphabet for each number. When the integer is negative, the word "fu" is first output. 10 numbers correspond to the following pinyin:
0:ling1:yi2:er3:san4:si5:wu6:liu7:qi8:ba9:jiu
Input format:
The input gives an integer in a row, such as: 1234
.
Tip: integers include negative numbers, 0, and positive numbers.
Output format:
In a row output this integer corresponding to the pinyin, each number of pinyin separated by a space, there is no last space at the end of the line. such as yi er san si
.
Input Sample:
-600
Sample output:
Fu Liu Ling Ling
1#include <iostream>2#include <stdio.h>3#include <cstring>4 using namespacestd;5 voidPrintCharch)6 {7 if(ch=='-') printf ("Fu");8 Else if(ch=='0') printf ("Ling");9 Else if(ch=='1') printf ("Yi");Ten Else if(ch=='2') printf ("er"); One Else if(ch=='3') printf ("San"); A Else if(ch=='4') printf ("si"); - Else if(ch=='5') printf ("Wu"); - Else if(ch=='6') printf ("Liu"); the Else if(ch=='7') printf ("Qi"); - Else if(ch=='8') printf ("BA"); - Else if(ch=='9') printf ("JIU"); - + } - intMain () + { A Chars[ +]; atCin>>s; - inti,len=strlen (s); - for(i=0; i<len-1; i++) - { - print (s[i]); -printf" "); in } -Print (s[len-1]); toprintf"\ n"); + return 0; -}
PAT Group Programming Ladder-practice set l1-007. Read the numbers.