#include "stdio.h"
int main(int argv,char *argc[]){
char m[12][10]={"January","February","March","April","May","June","July",
"August","September","October","November","December"},x;
printf("Enter a month:\nx=");
if(scanf("%d",&x)!=1 || x<1 || x>12){
printf("Input error, exit...\n");
return 0;
}
printf("Your input is %s.\n",m[x-1]);
return 0;
}
运行样例: