您的位置:首页 > 其它

HDU 2004 成绩转换

2016-10-03 18:05 309 查看

成绩转换

这个当年用if做的,当然最经典的是swich标签。

#include <stdio.h>
int main ()
{
int t;
while (scanf("%d",&t)!=EOF)
{
if(t>100)
printf("Score is error!\n");
else
if(t>89)
printf("A\n");
else
if(t>79)
printf("B\n");
else
if(t>69)
printf("C\n");
else
if(t>59)
printf("D\n");
else
if(t>-1)
printf("E\n");
else
printf("Score is error!\n");
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ACM