-
[python 알고리즘]백준 1546번(map 함수)/10798번(값이 존재한다면, split로 리스트 만들기, 이중 리스트)Python 알고리즘 2023. 9. 18. 22:04
https://www.acmicpc.net/problem/1546
1546번: 평균
첫째 줄에 시험 본 과목의 개수 N이 주어진다. 이 값은 1000보다 작거나 같다. 둘째 줄에 세준이의 현재 성적이 주어진다. 이 값은 100보다 작거나 같은 음이 아닌 정수이고, 적어도 하나의 값은 0보
www.acmicpc.net
N = int(input()) max =0 score = list(map(int,input().split())) for i in range(N): if score[i]>max: max = score[i] for j in range(N): score[j] = score[j]/max*100 average = sum(score)/len(score) print(average)
result=[] max = 0 for i in range(5): a = input() result.append(list(a)) if len(list(a)) > max: max = len(list(a)) for i in range(max): for j in range(5): if result[j][i] !='': print(result[j][i],end='')
'Python 알고리즘' 카테고리의 다른 글
[알고리즘]백준 1076번 (0) 2023.09.26 [Python 알고리즘]백준 11653번, 2903번 (0) 2023.09.05 [Python 알고리즘]python 기본 문법 (0) 2023.09.05