用户输入0-100之间的百分制成绩,将其转为五分制输出,下面正确的答案为:
A: score = float(input()) degree = "EEEEEEDCBAA" score_five = degree[score / 10] print(score_five)
B: score = float(input()) degree = "EEEEEEDCBAA" score_five = degree[score // 10] print(score_five)
C: score = float(input()) degree = "EEEEEEDCBAA" score_five = degree[int(score // 10)] print(score_five)
D: score = float(input()) degree = "EEEEEEDCBA" score_five = degree[int(score // 10)] print(score_five)
A: score = float(input()) degree = "EEEEEEDCBAA" score_five = degree[score / 10] print(score_five)
B: score = float(input()) degree = "EEEEEEDCBAA" score_five = degree[score // 10] print(score_five)
C: score = float(input()) degree = "EEEEEEDCBAA" score_five = degree[int(score // 10)] print(score_five)
D: score = float(input()) degree = "EEEEEEDCBA" score_five = degree[int(score // 10)] print(score_five)
举一反三
- 在如下结构体定义中,不正确的是○。 A: struct student { int no; char name[10]; float score; } B: struct stud[20] { int no; char name[10]; float score; } C: struct student { int no; char name[10]; float score; }stud[20]; D: struct{int no;char name[10];float score;}stud[100];
- 在如下结构体中,不正确的是( )。 A: struct student {char name[10]; float score; }; B: struct stu[5] {char name[10]; float score; }; C: struct student {char name[10]; float score; } stu[5]; D: struct {char name[10]; float score; }stu[5];
- 若有定义int score[10];,则对score数组中的元素的正确引用是( ) A: score[10] B: score[6.0] C: score[0] D: score(7)
- 在下列代码中,有( )处实现了拆箱。 int score=5; object o= score; o=10; score =(int)o; object oScore = score;
- 从键盘上输入一个百分制成绩score,按下列原则输出其等级:score≥90,等级为A;80≤score<90,等级为B;70≤score<80,等级为C;60≤score<70,等级为D;score<60,等级为E。