Calculus Midterm

来源:互联网 发布:svm推荐算法 编辑:程序博客网 时间:2024/05/23 02:03

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 100 0 0
Sample Output
I passed the exam.100Exam was too hard.0
水题。
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){    int n,m,z;    while(scanf("%d %d %d",&n,&m,&z)!=EOF)    {        int sum;        sum=n*3+m*2+6*z;        if(sum>60)        {            printf("I passed the exam.\n");        }        else        {            printf("Exam was too hard.\n");        }        printf("%d\n",sum);    }    return 0;}


原创粉丝点击