输入月份序号输出该月英文名,输入0程序结束,我写的这个输入负数就有乱码什么原因?

#include<stdio.h>

main()

{

char a[15][20]={"January","February","March","April","May","June","July","August","September","October","November","December"};

int x;

while(x!=0)

{

scanf("%d",&x);

if(x<0||x>12)

printf("error\n");

printf("%s\n",a[x-1]);

}

}


才下眉头却上我心头
浏览 1623回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP