某单位工号的编码规则:编码总长5位,均为数字,前4位依次整除以3,其值累加之和除以10的余数为第5位 数字。如某工号为76587,前4位分别整除3后,商分别为2、2、1、2,其累加之和为7,除以10的余数为7,故第5位 为7。下面的程序依次输入前4位数字,并计算输出最后一位。程序逐行输入前4位数字,要输出第5位数字。则在横 线处应填上的代码是( )。 for _ in range(25): max_score = 0 #记录最高分 min_score = 9999 #记录最低分 total_score = 0 #记录总分 for _ in range(10): now_score = float(input()) #录入评委打分 if now_score > max_score: max_score = now_score if now_score < min_score: min_score = now_score total_score += now_score print(total_score - max_score - min_score)
A. N % 3 rst // 10
B. N // 3 rst % 10
C. N % 3 rst % 10
D. N // 3 rst // 10
正确答案:B
试卷来源:202512 CCF-GESP编程能力等级认证Python二级真题