#include <iostream>
#include <cstring>
using namespace std;
int change(int m)
{
switch(m)
{
case 0:cout<<"zero";
break;
case 1:cout<<"one";
break;
case 2:cout<<"two";
break;
case 3:cout<<"three";
break;
case 4:cout<<"four";
break;
case 5:cout<<"five";
break;
case 6:cout<<"six";
break;
case 7:cout<<"seven";
break;
case 8:cout<<"eight";
break;
case 9:cout<<"nine";
break;
}
}
int main()
{
char ch[101];
int sum=0,b[100],x=0;
cin>>ch;
if(ch[0]=='0'&&strlen(ch)==1) cout<<"zero";
else
{
for(int i=0;i<strlen(ch);i++)
{
int t=ch[i]-'0';
sum+=t;
}
while(sum)
{
int p=sum%10;
b[x++]=p;
sum/=10;
}
x--;
while(x!=-1)
{
change(b[x]);
x--;
if(x!=-1) cout<<" ";
}
}
return 0;
}
(甲)1005 Spell It Right
最新推荐文章于 2024-10-10 21:41:52 发布
