03-4. Score conversion (15)

Source: Internet
Author: User

This question requires programming to convert a percentage to a five-digit score. Conversion rules:

 

  • If the value is greater than or equal to 90, it is divided into;
  • B is smaller than 90 and greater than or equal to 80;
  • Less than 80 and greater than or equal to 70 is C;
  • Less than 70 and greater than or equal to 60 is D;
  • Less than 60 is E.

     

    Input Format:

    Enter the percentage score of 1 integer in a row.

    Output Format:

    Output the corresponding five-digit score in one row.

    Input example:
    90
    Output example:
    A

 

1 # include <stdio. h> 2 int main () 3 {4 int N; 5 scanf ("% d", & N); 6 7 switch (N/10) 8 {9 case 10:10 case 9: printf ("A"); break; 11 case 8: printf ("B"); break; 12 case 7: printf ("C"); break; 13 case 6: printf ("D"); break; 14 default: printf ("e"); break; 15} 16 17 return 0; 18}

 

03-4. Score conversion (15)

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.