编程划分学生成绩等级

90-100为A 80-89为B 70-79为C 60-69为D 60以下为E
用多分支if语句编写
用switch语句编写

// 1. 方法一
#include<stdio.h>
 int main()
{
    printf("请输入成绩:\n");
    float score;
    scanf_s("%f", &score);
    if (score >= 90)
        printf("成绩等级为:A\n");
    else
        if (score >= 80)
            printf("成绩等级为:B\n");
        else
            if (score >= 70)
                printf("成绩等级为:C\n");
            else
                if (score >= 60)
                    printf("成绩等级为:D\n");
                else
                    printf("成绩等级为:E\n");
}

// 2。方法二
#include<stdio.h>
 int main()
{
    printf("请输入成绩:\n");
    float score;
    scanf_s("%f", &score);
    if (score >= 90)
        printf("成绩等级为:A\n");
    else
        if (score >= 80)
            printf("成绩等级为:B\n");
        else
            if (score >= 70)
                printf("成绩等级为:C\n");
            else
                if (score >= 60)
                    printf("成绩等级为:D\n");
                else
                    printf("成绩等级为:E\n");
}