A题:
题目牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ来源:牛客网
又快到期末了,LakerV想起他上个学期被考试周支配的恐惧。拼搏五日,我要上大二。成为了他的座右铭。
在考试周里,周一到周五分别要考一科课程。所以LakerV会在当天早上预习这门课程,准备下午的考试。但作为一名算法竞赛选手,LakerV相信自己不需要预习数据结构和算法这门课程。所以他在那天早上可以待在宿舍打游戏。
现在告诉你周一到周五的考试安排,以及周几,请你告诉他那天早上他在干啥。
周一到周五的考试安排:
周一:Higher mathematics
周二:Linear algebra
周三:Principle of computer composition
周四:Database system concept
周五:Data structures and algorithms (数据结构和算法)
输入描述:一个正整数,表示周几输出描述:
如果LakerV在预习课程,输出You were studying x! (x表示课程名称)
否则输出You were playing games!
示例1
输入1
输出You were studying Higher mathematics!
示例2
输入5
输出You were playing games!
题解:
#include
int main()
{
int n;
scanf("%d",&n);
if(n==1)
printf("You were studying Higher mathematics!n");
else if(n==2)
printf("You were studying Linear algebra!n");
else if(n==3)
printf("You were studying Principle of computer composition!n");
else if(n==4)
printf("You were studying Database system concept!n");
else if(n==5)
printf("You were playing games!n");
return 0;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)