Problem Description Yellowstar刚考完微积分期中考,微积分期中考卷一共三个部分,8道选择题每题3分,8道填空题,每题2分,10题答题每题6分,总分100分。Yellowstar考完期中考后已经失去了计算能力,他只记得每部分对的题数,现在想请你帮忙计算一下他的得分,能否通过考试。
Input 多组数据,处理到EOF。 每组数据输入3个整数 x,y,z(0<=x<=8,0<=y<=8,0<=z<=10)分别表示选择题、填空题和简答题正确的题数。
Output 每组数据需要输出两行,如果他最少的得分大于等于60 ,第一行输出“I passed the exam.”(双引号不需要输出),第二行输出他的得分;如果他最低得分小于60,第一行输出“Exam was too hard.”(双引号不需要输出),第二行输出他的得分。
Sample Input 8 8 10 0 0 0
Sample Output I passed the exam. 100 Exam was too hard. 0
#include<cstdio> int main() { int a,b,c; while(scanf("%d%d%d",&a,&b,&c)==3) { int sum=3*a+2*b+6*c; if(sum>=60) printf("I passed the exam.\n"); else printf("Exam was too hard.\n"); printf("%d\n",sum); } return 0; }so easy