"0", "zero",
"芹拆1", "one",
"2", "two",
"3", "three",
"4"嫌判枣, "four",
"5", "five",
"6", "six",
"7", "seven",
"8", "eight",
"9", "nine" }
char buf[256] = { 0 }
gets(buf)
for (int i = 0 i 冲笑< 20 i+=2)
{
if (*buf == str[i][0])
{
for (int j=0 j < 6 j++)
{
printf("%c", str[i+1][j])
}
//break
}
}
getchar()
#include<stdio.h>int main()
{
int i
int n
int size = 0
int num[20] = {0}
乱凳scanf("%d", &n)
while(n > 0)
{
num[size++] = (n%10)
n /= 10
}
if(size == 0)
{
printf("zero\n")
return 0
}
for(i = size-1 i >= 0 --i)
{
switch (num[i])
{
case 0:
{
printf("zero")
break
}
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
}
}
if(i != 0)
{
printf(",")
}
else
{
printf("\n")
}
}
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)