FZU 2229 Calculus Midterm

来源:互联网 发布:ubuntu打开共享文件夹 编辑:程序博客网 时间:2024/05/21 04:40

Problem 2229 Calculus Midterm

Accept: 813    Submit: 1233
Time Limit: 1000 mSec    Memory Limit : 32768 KB

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<iostream>using namespace std;int main(){int x,y,z;while(~scanf("%d%d%d",&x,&y,&z)){int sum=0;sum+=x*3+y*2+z*6;if(sum>=60) printf("I passed the exam.\n%d\n",sum);else printf("Exam was too hard.\n%d\n",sum);}}