Hangzhou (Hangzhou), 2004 20:04:30

Source: Internet
Author: User
Score Conversion

Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 75179 accepted submission (s): 33050


Problem description: enter a percentage t to convert the score to the corresponding level. The specific conversion rules are as follows:
90 ~ 100 is;
80 ~ 89 is B;
70 ~ 79 is C;
60 ~ 69 is D;
0 ~ 59 is E; input data contains multiple groups, each of which occupies one row and is composed of an integer. Output outputs a row of input data for each group. If the input data is not 0 ~ Within the range of 100, please output a line: "score is error !". Sample input5667100123 sample outputedascore is error!
 1 #include<cstdio> 2 int main() 3 { 4     int m; 5     while(scanf("%d",&m)==1) 6     { 7         if(m<0||m>100){printf("Score is error!\n");continue;} 8         switch(m/10) 9         {10             case 10:case 9:printf("A\n");break;11             case 8:printf("B\n");break;12             case 7:printf("C\n");break;13             case 6:printf("D\n");break;14             default:printf("E\n");break;15         }16     }17     return 0;18 }

 

Hangzhou (Hangzhou), 2004 20:04:30

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.