[求助]简单奇妙的问题
输入月份数字,输出相应英文名字
#include"stdio.h"
#include"conio.h"
main()
{
int i,n ;
static char a[][11]=
{
"invalid","january","february","march","april","may","june",
"july","august","september","october","november","december"
}
;
printf("input the month\n");
scanf("%d",&n);
printf("it's %s\n",(0<n<13)?a[n]:a[0]);
return(0);
}
输入15就完蛋
printf("it's %s\n",(a<1||a>12)?a[0]:a[n]);
然后就OK
有什么区别???