Enter a hundred score T to convert it to the corresponding level the input data has multiple groups, one row for each group, and an integer.

Source: Internet
Author: User

I. Requirements

The specific conversion rules are as follows: 90~100 is A; 80~89 is b; 70~79 is C; 60~69 is D; 0~59 is E;

The input data has multiple groups, one row for each group, and an integer.

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!".

Second, code implementation

#include <stdio.h>
int main ()
{
    int score;
    while (~SCANF ("%d", &score))
    {
        if (score>=90&&score<=100)
            printf ("a\n");
        if (score>=80&&score<90)
            printf ("b\n");
        if (score>=70&&score<80)
            printf ("c\n");
        if (score>=60&&score<70)
            printf ("d\n");
        if (score>=0&&score<60)
            printf ("e\n");
        if (score<0| | score>100)
            printf ("Score is error!\n");
    }
    return 0;
}


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.