Love丶FFC's Blog
读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。
每个测试输入包含 1 个测试用例,格式为
第 1 行:正整数 n
第 2 行:第 1 个学生的姓名 学号 成绩
第 3 行:第 2 个学生的姓名 学号 成绩
... ... ...
第 n+1 行:第 n 个学生的姓名 学号 成绩
其中姓名
和学号
均为不超过 10 个字符的字符串,成绩为 0 到 100 之间的一个整数,这里保证在一组测试用例中没有两个学生的成绩是相同的。
对每个测试用例输出 2 行,第 1 行是成绩最高学生的姓名和学号,第 2 行是成绩最低学生的姓名和学号,字符串间有 1 空格。
3
Joe Math990112 89
Mike CS991301 100
Mary EE990830 95
Mike CS991301
Joe Math990112
1.使用列表存储三个字段的值
2.对成绩进行判断并保留列表索引
NOP = int(input()) Student = [["Name", "ID", "Score"] for i in range(NOP)] # 创建姓名、学号、成绩的列表 MaxScore, MinScore, MaxIndex, MinIndex = 0, 100, 0, 0 # 初始化最高成绩和最低成绩、最高成绩和最低成绩对应的学生在列表中的索引 for i in range(NOP): Student[i] = list(map(str, input().split())) if int(Student[i][2]) > MaxScore: # 出现更高成绩 MaxScore = int(Student[i][2]) MaxIndex = i if int(Student[i][2]) < MinScore: # 出现更低成绩 MinScore = int(Student[i][2]) MinIndex = i print(Student[MaxIndex][0], Student[MaxIndex][1]) # 输出最高成绩学生姓名和学号 print(Student[MinIndex][0], Student[MinIndex][1]) # 输出最低成绩学生姓名和学号
Jorcift
cialis online reviews Such modifications include, for example, deletions from, and or insertions into and or substitutions of, residues within the amino acid sequences of the antibody
cheap jordans for sale
Read reviews and was a little hesitant since I had already inputted my order. as but thank god, I had no issues. just like received item in a timely matter, they are in new condition. regardless so happy I made the purchase. Will be definitely be purchasing again.
cheap jordans for sale https://www.realcheapretrojordanshoes.com/
louis vuitton outlet
Read reviews and was a little hesitant since I had already inputted my order. or but thank god, I had no issues. particularly the received item in a timely matter, they are in new condition. anyway so happy I made the purchase. Will be definitely be purchasing again.
louis vuitton outlet https://www.louisvuittonsoutletstore.com/
cheap louis vuitton bags
Read reviews and was a little hesitant since I had already inputted my order. or possibly a but thank god, I had no issues. for instance the received item in a timely matter, they are in new condition. either way so happy I made the purchase. Will be definitely be purchasing again.
cheap louis vuitton bags https://www.louisvuittonsoutletonline.com/
intuido
buying generic cialis online safe This article was written by Kara Maxwell, MD, PhD
intuido
its close to the same type buy cialis online united states At first blush, it might seem that an increase in creatinine and BUN in the thiazide group might be a bad thing they re hurting the kidneys
ESCVdf
buy propecia 5mg Blood clots eg, deep vein thrombosis, pulmonary embolism or history of Should not be used in patients with this condition
Yazfge
order fenofibrate 200mg online cheap tricor pills order fenofibrate 200mg for sale
Pfwquy
tadalafil 40mg cheap buy viagra generic sildenafil overnight
Wgnfap
zaditor 1 mg brand buy ketotifen generic buy tofranil pills
Ujyzov
buy minoxidil without a prescription online ed meds buy generic ed pills over the counter
Lkrvts
buy precose for sale buy griseofulvin 250 mg without prescription order griseofulvin without prescription