Description
We know that the examinations is based on rank. 90~100 is A; 80~89 is b; 70~79 is C; 60~69 is D; 0~59 is E. Write a program that converts the input to a hundred grade t, converting it to a corresponding rank.
Input
The input data has multiple groups, one row for each group, and an integer.
Output
For each set of input data, output one row. If the input data is not in the 0~100 range, output one line: "Score is error!".
* Copyright (c) 2014, Computer College of Yantai University
* All rights reserved.
* File name: Test.cpp
* Author: Chen Dani
* Completion date: May 20, 2015
* Version number: v1.0 * *
#include <iostream>
using Nam Espace std;
int main ()
{
int n;
while (Cin>>n)
{
if (n>100| | n<0)
cout<< "Score is error!" <<endl;
else if (n>=90&&n<=100)
cout<< "A" <<endl;
else if (n>=80)
cout<< "B" <<endl;
else if (n>=70)
cout<< "C" <<endl;
else if (n>=60)
cout<< "D" <<endl;
else if (n>=0)
cout<< "E" <<endl;
}
return 0;
}
Experience: Do not rush to the results of efforts, kungfu to do enough to receive the results of the goods. Keep trying.