07-0. Write this number (20) time limit of MS memory limit 65536 KB code length limit 8000 B award Program StandardAuthor Chen, Yue
Read in a natural number n, calculate the sum of their numbers, and write each digit in Hanyu Pinyin.
input Format: each test input contains 1 test cases, which gives the value of the natural number N. This guarantees that n is less than 10100.
output format: output n in one line each digit of the sum of the number of digits, there are 1 spaces between the phonetic numerals, but there is no space after the last phonetic number in a row.
Input Sample:
1234567890987654321123456789
Sample output:
Yi San Wu
Submit code #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main ()
{
Char ig[101];
memset (ig,0,sizeof (IG));
Gets (IG);
int n=0;
for (int i=0;i<strlen (IG); i++)
{
int temp=ig[i]-' 0 ';
N+=temp;
}
int lgd[101];
int i=0;
while (n/10!=0)
{
lgd[i]=n%10;
printf ("%d", lgd[i]);
N=N/10;
i++;
}
Lgd[i]=n;
int n;
Char skt[101];
memset (skt,0,sizeof (Skt));
for (int j=i;j>=0;j--)
{
N=LGD[J];
Switch (n)
{
Case 0:
strcat (Skt, "Ling");
Case 1:
strcat (Skt, "Yi");
Case 2:
strcat (Skt, "er");
Case 3:
strcat (Skt, "San");
Case 4:
strcat (Skt, "Si");
Case 5:
strcat (Skt, "WU");
Case 6:
strcat (Skt, "Liu");
Case 7:
strcat (Skt, "Qi");
Case 8:
strcat (Skt, "ba");
Case 9:
strcat (Skt, "JIU");
Default
Break
}
}
for (int j=0;j<strlen (SKT) -1;j++)
printf ("%c", Skt[j]);
printf ("\ n");
printf ("%d", lgd[i]);
return 0;
}
Programming Ability Test Study 07-0. Write this number (20)