1.10 编程基础之简单排序 04 奖学金 7分 python
生活随笔
收集整理的這篇文章主要介紹了
1.10 编程基础之简单排序 04 奖学金 7分 python
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://noi.openjudge.cn/ch0110/04/
""" 1.10 編程基礎之簡單排序 04 獎學金 7分 http://noi.openjudge.cn/ch0110/04/Python格式化輸出 https://blog.csdn.net/weixin_33857230/article/details/85630192python輸出姓名和最高成績_【Python】1004分排名(20分),Python1004,成績排名 https://blog.csdn.net/weixin_39649614/article/details/111440842 """n=int(input())student=[]for i in range(n) :score01,score02,score03=input().split()#并行輸入score=int(score01)+int(score02)+int(score03)student.extend([i+1,int(score)])#將一次輸入的數據添加到列表里#print(student)for i in range(1,len(student),2) :#print(i)#print(student[i])for j in range(i+2,len(student),2):#print(i)#print(j)if student[i] < student[j]:student[i], student[j] = student[j], student[i]student[i-1], student[j-1] = student[j-1], student[i-1]if student[i] == student[j]:if student[i-1] > student[j-1]:student[i], student[j] = student[j], student[i]student[i-1], student[j-1] = student[j-1], student[i-1]for i in range(1,11,2) :print(student[i-1],end=' ')print("%d"%student[i])#print(student)總結
以上是生活随笔為你收集整理的1.10 编程基础之简单排序 04 奖学金 7分 python的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【选篇】聪哥诗集
- 下一篇: 4.2 算法之数论 185 反正切函数的