是判断一个学生考试成绩及格与否的程序(成绩A,或B,或C者为及格;成绩为D者不及格).

1个回答

  • switch((int)(grade/10))

    case(10):chgrade ='A' ;break;

    case(9): chgrade ='A';break;

    case(8): chgrade ='B';break;

    case(7): chgrade ='C';break;

    case(6): chgrade ='D';break;

    default: printf("%sn","fail!");

    }