Assessment of students ' grades: less than 60 is "E", 60~69 is "D", 70~79 is "C", 80~89 is "B", and more than 90 is "A"

Source: Internet
Author: User

#define RET_OK 1
#define RET_ERR 1


int judge_score (int score,char *ch)
{
if (Score > | | Score < 0)
{
printf ("The score you input should little than and bigger than 0\n");
return ret_err;
}

Switch (SCORE/10)
{
Case 10:
Case 9:
*ch = ' A ';
Break
Case 8:
*ch = ' B ';
Break
Case 7:
*ch = ' C ';
Break
Case 6:
*ch = ' D ';
Break
Default
*ch = ' E ';
Break
}
return RET_OK;
}


int main (int argc,char argv[])
{
Char score = 0;
char ch = ' 0/';

while (scanf ("%d", &score)! = ' Q ')
{
Judge_score (SCORE,&AMP;CH);
printf ("\r\nresult:%c\r\n", ch);
}

return RET_OK;
}

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Assessment of students ' grades: less than 60 is "E", 60~69 is "D", 70~79 is "C", 80~89 is "B", and more than 90 is "A"

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.