C语言 输入月份数,输出对应的英文名
Posted C语言大本营
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C语言 输入月份数,输出对应的英文名相关的知识,希望对你有一定的参考价值。
#include <stdio.h>
int main()
char *month_name[13]="illegal month","January","February","March","April","May","June","July","August","September","October","November","December";
int n;
printf("请输入月份数:");
scanf("%d",&n);
if((n<=12)&&(n>=1))
printf("It is %s.",*(month_name+n));
else
printf("It is wrong.");
return 0;
以上是关于C语言 输入月份数,输出对应的英文名的主要内容,如果未能解决你的问题,请参考以下文章