[백준] 4344번 : 평균은 넘겠지 - Python(파이썬)

강재원·2022년 10월 29일
0

[코딩테스트] Python

목록 보기
161/200



https://www.acmicpc.net/problem/4344

n=int(input())
for i in range(n):
    arr=list(map(int,input().split()))
    sum=0
    count=0
    for j in range(arr[0]):
        sum+=arr[j+1]
    ave=sum/arr[0]
    for j in range(arr[0]):
        if arr[j+1]>ave: count+=1
    print("%.3f%c" % (count*100/arr[0],'%'))
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글