题解 | #小乐乐转换成绩#
小乐乐转换成绩
http://www.nowcoder.com/practice/ba62e0d2e9824543963f72f1e926858d
#include <stdio.h> int main() { int score = 0; scanf("%d", &score); int c = score / 10; if (score >= 0) { switch (c) { case 9: case 10: printf("A\n"); break; case 8: printf("B\n"); break; case 7: printf("C\n"); break; case 6: printf("D\n"); break; case 5: case 4: case 3: case 2: case 1: case 0: printf("E\n"); break; default: printf("F\n"); break; } } else { printf("F\n"); } return 0; }
编程初学者入门训练 文章被收录于专栏
针对编程初学者入门训练130题的代码详解专栏,内附注释方便理解,牛客130题的代码均用C语言实现,方便初学者学习。