python/리스트
학생성적관리 프로그램[4단계]
june__Park
2021. 2. 28. 00:02
# 학생성적관리 프로그램[4단계] : 1등학생
hakbuns = [1001, 1002, 1003, 1004, 1005]
scores = [87, 11, 92, 14, 47]
# 문제) 1등학생의 학번과 성적 출력
# 정답) 1003번(92점)
i=0
top=-1
topidx=-1
while i<5:
if scores[i] > top:
top = scores[i]
topidx=i
i+=1
print(hakbuns[topidx],"번(%d점)"%top)