单选题

我们要统计全年级 100 个同学的成绩,其中 85 分以上的算为优秀。以下的选项中,能正确地统计出优秀的个数的是?(     )

A

total = 0

for i in range(1, 100):

    score = input("输入成绩:")

    score = int(score)

    if score > 85:

        total = total +1

print("优秀的学生的个数是:", total)

B

total = 0

n = 0

while n < 100:

    score = input("输入成绩:")

    score = int(score)

    if score > 85:

        total = total +1

        n = n + 1

print("优秀的学生的个数是:", total)

C

total = 0

n = 0

while n < 100:

    score = input("输入成绩:")

    score = int(score)

    if score > 85:

        total = total +1

    n = n + 1

print("优秀的学生的个数是:", total)

D

for i in range(100):

    score = input("输入成绩:")

    score = int(score)

    if score > 85:

        total = total +1

print("优秀的学生的个数是:", total)

赣ICP备20007335号-2