Read integer,
Subject content:
Your program needs to read an integer in the range of [-100000,100000]. Then, output each digit of the integer in Chinese pinyin.
If 1234 is input, the output is:
Yi er san si
Note that there is a space between the pinyin characters, but there is no space behind the last word. When a negative number is encountered, add "fu" at the beginning of the output, for example,-2341 output:
Fu er san si yi
Input Format:
An integer in the range of [-100000,100000].
# Include <stdio. h>
Int main (){
Int a, digit = 100000;
Scanf ("% d", & );
If (a <0 ){
Printf ("fu ");
A =-;
}
While (digit> 1)
{
If (a/digit! = 0)
{
Break;
}
Digit/= 10;
}
For (; digit> 0; digit/= 10 ){
Switch (a/digit)
{
Case 1:
Printf ("yi ");
Break;
Case 2:
Printf ("er ");
Break;
Case 3:
Printf ("san ");
Break;
Case 4:
Printf ("si ");
Break;
Case 5:
Printf ("wu ");
Break;
Case 6:
Printf ("liu ");
Break;
Case 7:
Printf ("qi ");
Break;
Case 8:
Printf ("ba ");
Break;
Case 9:
Printf ("jiu ");
Break;
Case 0:
Printf ("ling ");
Break;
}
A-= (a/digit) * digit;
If (digit! = 1 ){
Putchar ('');
}
}
Return 0;
}