【答案】枚举变量对应的枚举常量值是整数,不能直接输出枚举常量的英文名称,应itch语句逐一进行比较判断。对应的程序如下:include void main()enum r
January = 1, February, March,April, May, June,July, August, September,October, November, December };char month[12][MAXSIZE] = { "January", "February", "March","April", "May", "June","July", "August", "September","October", "November", "December"};void ShowMonth(int...
百度试题 题目编写一个C程序,定义一个一周的枚举变量,根据键盘输入的一周中的星期几(整数值),输出其英文名称。相关知识点: 试题来源: 解析反馈 收藏
【答案】枚举变量对应的枚举常量值是整数,不能直接输出枚举常量的英文名称,应使tch语句逐一进行比较判断。对应的程序如下include void main()enum {r
【答案】枚举变量对应的枚举常量值是整数,不能直接输出枚举常量的英文名称,应使witch语句逐一进行比较判断。对应的程序如下:include void main()( en
【答案】枚举变量对应的枚举常量值是整数,不能直接输出枚举常量的英文名称,应使switch语句逐一进行比较判断。对应的程序如下:include void main()enu
【答案】枚举变量对应的枚举常量值是整数,不能直接输出枚举常量的英文名称,应使 witch语句逐一进行比较判断。对应的程序如下 include void main() enum red, yellow, blue, green, black, white} int r: printf ("n: ") scanf ("d", &n); switch (n) case 0: printf ("red\n") break:...
编写一个C程序,定义一个一周的枚举变量,根据键盘输入的一周中的星期几(整数值),输出其英文名称。 正确答案 答案解析 略 真诚赞赏,手留余香 小额打赏 169人已赞赏
,"May","June","July","August","September","October","November","December"};int i;while(1){ cout<<"Please input month No.(1~12):\n";cin>>i;if ( i<1||i>12){ cout<<"Error!"<<endl;break;} cout<<"month No."<<i<<"--->"<<monthname[i-1]<<endl;} } ...