编写一个用指针数组处理的C程序,实现从键盘输入月份时输出对应的英文名。

2024-11-29 23:03:59
推荐回答(1个)
回答1:

#include "stdio.h"

int main()
{
int m;
char *months[]={"January","February","March","April","May","June","July","August","September","October","November","December"};
printf("Input Month:");
scanf("%d",&m);
printf("The month is:%s",*(months+m-1));
}