void main(){ int week;char weekstr[7][3]={"天“,”一","二","三","四","五","六"};printf("请输入数字(0-6):");scanf("%d",&week);if(week<=6)printf("星期%s\n",weekstr[week]);else printf("输入错误!\n");} ...
你在写程序的时候加一个判断就好了啊,0应该是周日把,1代表周一等 你在程序上添加一个输入框textbox,if(textbox.text=="1")输出 周一 else if (textbox.text=="2")输出 周二 else if (textbox.text=="3")输出 周三 else if (textbox.text==4")输出 周四 else if (textbox....
char *weeks[]={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};int i;std::cout<<"请输入0-6的数字:"<<std::endl;std:cin>>i;if (i>=0&&i<=6){ std:cout<<weeks[i]<<std:endl;} else{ std:cout<<"输入不正确!"<<std:endl;} ...
5.编写输入一个0~6数字,显示汉字对照输出星期的Function过程。程序运行结果如图8所示。 图8Form1口×输入一个整数6星期六Saturday 相关知识点: 试题来源: 解析 程序代码: Dim x As Integer Private Function Mystring(x As Integer) As String Select Case x Case 1 Mystring = "星期一" + Chr(13) + "...
include <stdio.h>int main(void){char *w[]={"sun","mon","tues","wed","thur","fri","sat"};int i;for(i=0;i<7;++i)puts(w[i]);return 0;}
程序:include (iostream.h)void main(void){int day;com>>day;switch(day){case 0: cout<<"Sunday"<<endl;break;case 1: cout<<"Monday"<<endl;break;case 2: cout<<"Tuesday"<<endl;break;case 1: cout<<"Wednesday"<<endl;break;case 1: cout<<"Thursday"<<endl;break;case 1: ...
要求输入0-6之间的任意一个数字,输出一个对应星期几的英文单词。 暂无答案
printf("星期日\n");break;case 1:printf("星期一\n");break;case 2:printf("星期二\n");break;case 3:printf("星期三\n");break;case 4:printf("星期四\n");break;case 5:printf("星期五\n");break;case 6:printf("星期六\n");break;default:printf("input fail\n");break;} ...
VC++面向对象编程 1.用枚举值MON、TUE、WED、THU、FRI、SAT和SUN表示一个星期中的7天.从键盘输入一个0~6之间的整数,根据输入的整数输出对应的