建一个
字符串数组,数组下标号码 对应月份,里面存该月份 英文词即可。
c 语言程序如下:
#include <stdio.h>
int main(){
char *sm[13]={" ","January","February",
"March","April","May","June",
"July","August","September",
"October","November","December"};
int i,m;
printf("input month 1 or 2 or ..or 12\n");
scanf("%d",&m);
printf("It is: %s\n", *(sm+m));
return 0;
}