1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > C语言#用switch语句判断今天是星期几?

C语言#用switch语句判断今天是星期几?

时间:2024-01-12 00:20:32

相关推荐

C语言#用switch语句判断今天是星期几?

#include<stdio.h>int main(void){int day = 0;printf("请输入星期数:");scanf_s("%d", &day);switch (day){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;case 7:printf("今天是星期日\n");break;}return 0;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。