#include"stdio.h"
int main()
{
int a=0,c=0;
char str1[120];
gets(str1);
while(str1[a]!='\0'){
c=c+str1[a]-'0';
a++;
}
int i=0;
char str[120];
if(c==0)
printf("zero");
while(c){
a=c%10;
str[i]=a+'0';
i++;
str[i]=' ';
i++;
c=c/10;
}
i-=2;
while(i>-1){
switch(str[i]){
case '1':printf("one");break;
case '2':printf("two");break;
case '3':printf("three");break;
case '4':printf("four");break;
case '5':printf("five");break;
case '6':printf("six");break;
case '7':printf("seven");break;
case '8':printf("eight");break;
case '9':printf("nine");break;
case '0':printf("zero");break;
default:printf(" ");break;
}
i--;
}
getchar();getchar();
return 0;
}
1005. Spell It Right (20)
最新推荐文章于 2022-02-25 20:00:37 发布