这个题目明显用数组比用switch简单

2007-04-17 18:49

2007-04-17 18:58
2007-04-17 19:54
2007-04-17 21:39
我改了以下你的代码
#include<stdio.h>
void main()
{
char a[10][10]={"zero","one","tow","tree","four","five","six","seven","eght","nine"};
int i;
while(scanf("%1d",&i)!=EOF)
{
printf("%s ",a[i]);
}
}

2007-04-17 21:59
mp3改的好简洁,佩服
2007-04-17 22:22
2007-04-17 22:24
我改了以下你的代码
#include<stdio.h>
void main()
{
char a[10][10]={"zero","one","tow","tree","four","five","six","seven","eght","nine"};
int i;
while(scanf("%1d",&i)!=EOF)
{
printf("%s ",a[i]);
}
}
#include<stdio.h>
void main()
{
char a[10][10]={"zero","one","tow","tree","four","five","six","seven","eght","nine"};
char c;
while((c=getchar())!='\0')
{
printf("%s ",a[c-'0']);
}
}

2007-04-17 22:32
2007-04-17 22:35
2007-04-17 22:46