已知x代表某个百分制成绩,下列程序段用于显示对应的五级制成绩,正确的是( )
A.If x>=60 Then Print"及格" Else If x>=70 Then Print"中" Else If x>=80 Then Print"良" Else If x>=90 Then Print"优" Else Print"不及格" End If
B.If x<90 Then Print"良" Else If x<80 Then Print"中" Else If x<70 Then Print"及格" Else If x<60 Then Print"不及格" Else Print"优" End If
C.If x>=90 then Print"优" Else If x>=80 Then Print"良" Else If x>=70 Then Print"中" Else If x>=60 Then Print"及格" Else Print"不及格" End If End Select
D.Select Case x Case x>=90 Print"优" Case x>=80 Print"良" Case x>=70 Print"中" Case x>=60 Print"及格" Case Else Print"不及格"
第1题:
写出程序段对应的运行结果 int x = 4; System.out.print("x=" +((x > 4) ? 99.99 : 9));
第2题:
写出程序段对应的输出结果 int x = 125; System.out.print(x/10);
第3题:
写出以下程序段对应的输出结果 int x = 23659; String m = "result="; while (x>0) { m = m + x%10; x = x/10; } System.out.print(m);
第4题:
设 x = 1; y = 10,下列语句能正确运行结束的是________。
A.if(x>y) print(x)
B.max = x >y ? x : y
C.if x>y max=x
D.if x<y: min=x else: min=y
第5题:
【其它】编写程序:某学生有两门考试课程,实行百分制考核。编写程序,输入这两门课程的成绩,计算其平均成绩。