1002. Write this number (20) Time Limit 400 MS
Memory limit 32000 KB
CodeLength limit 8000 B
JudgementProgram Standard Author Chen, Yue
Read a natural number N, calculate the sum of all its numbers, and write each digit in Chinese pinyin.
Input Format:Each test input contains one test case, that is, the value of natural number n. N must be less than 10100.
Output Format:Output each digit of N in a row. There is a space between the pinyin numbers, but there is no space after the last pinyin number in a row.
Input example:
1234567890987654321123456789
Output example:
Yi San Wu
Complete code:
# include
# include
# include
using namespace STD; string getresult (int n) {Switch (n) {Case 0: Return "Ling"; break; Case 1: Return "Yi"; break; Case 2: Return "er "; break; Case 3: Return "San"; break; Case 4: Return "Si"; break; Case 5: Return "Wu"; break; Case 6: Return "Liu "; break; Case 7: Return "Qi"; break; case 8: Return "ba"; break; Case 9: Return "Jiu "; Break ;}} int main () {string num; stack
S; string: iterator it; int Total = 0; CIN> num; For (IT = num. begin (); it! = Num. end (); It ++) {total + = * It-'0';} while (total) {S. push (Total % 10); Total/= 10;} cout