printf("请输入1-7数字\n"); scanf("%d",&i); switch(i) { case 1: printf("今天星期一");break; case 2: printf("今天星期二");break; case 3: printf("今天星期三");break; case 4: printf("今天星期四");break; case 5: printf("今天星期五");break; case 6: printf("今天星期六")...
c语言输入1到7输出星期几 (1)week=['MON','TUE','WED','THU','FRI','SAT','SUN']while True:n=int(input("请输入数字1~7(输入0结束):"))if n==0:print("程序结束!")break elif 1<=n and n<=7:print(week[n-1])else:print("请重新输入")(2)n=int(input("输入一个整数:"))a=b=...
w = (c / 4) - 2 * c + (y + y / 4) + (13 * (m + 1) / 5) + d - 1; while (w < 0) w += 7; w %= 7; if (w == 0) printf ("星期日"); else printf ("星期%d", w); return 0; } 方法二: #include void main () { int y,m,d,c,s,w; printf("请...
include<stdio.h>#include<string.h>int main(){char a[8][20]={"","monday","tuesday","wednesday","thursday","friday","saturday","sunday"};int n;scanf("%d",&n);puts(a[n]);return 0; } /*输出:7sunday */
void main() { int week; scanf("%d",&week); if(week==1) printf("星一"); if(week==2) ... }登录百度帐号 扫二维码下载贴吧客户端 下载贴吧APP看高清直播、视频! 贴吧页面意见反馈 违规贴吧举报反馈通道 贴吧违规信息处理公示4
【题目】C语言实验星期几任意输入英文的星期几,通过查找如右图所示的星期表(无图,其中0对应Sunday、1对应Monda、.、6对应Saturday),输出其对应的数字,
假设星期一至星期五每工作一小时的工资是20元,星期六和星期日每工作一小时的工资是平时的3倍,其中工资的4.5%是税金,试编一程序从键盘输入星期号(1,2,3,4,5,6,7分别表示星期一至星期五)和工作小时数,计算该日的工资及税金。 2【题目】C语言。。求解。假设星期一至星期五每工作一小时的工资是20元,星期六...
b=count%7;switch(b){ case 1:printf("The day is Monday\n");break;case 2:printf("The day is Tuesday\n");break;case 3:printf("The day is Wednesday\n");break;case 4:printf("The day is Thursday\n");break;case 5:printf("The day is Friday\n");break;case 6:printf("...
= 0 || i % 400 == 0)/*i年为闰年*/y = 366;elsey = 365;k = k + y;}for (j = 1; j <= b - 1; j++)/*按月算天数*/{if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 || j == 12)d = 31;else if (j == 4 || ...
else if (week <=0) week += 7; printf("%d年%d月%d日是星期%s\n", year, mon, day, WEEK_DAY[week-1]);}int main(){ int n, y, m, d, days, week; char str[1001], *p; printf("输入年月日(用空格隔开): "); scanf("%d%d%d", &y, &m, &d); countWeek(y, m, d); sy...