[백준] #4344 평균은 넘겠지 python
2022. 12. 21. 17:12
https://www.acmicpc.net/problem/4344
소숫점 처리 방법을 배웠다 !
print(f"{}")
방법도 있지만, .format 방법이나 round도 있음을 알았다.
N = int(input())
for _ in range(N):
num_list = list(map(int, input().split()))
rate = num_list[0]
result_val = 0
for i in range(1,len(num_list)):
result_val += num_list[i]
result_tmp = result_val/rate
cnt = 0
for i in num_list[1:]:
if result_tmp < i:
cnt += 1
print("{:.3f}".format(cnt/rate * 100)+"%")
'Programming > Algorithm' 카테고리의 다른 글
[백준] #1065 한수 python (0) | 2022.12.21 |
---|---|
[백준] #4673 셀프 넘버 python (0) | 2022.12.21 |
[백준] #8958 OX퀴즈 python (0) | 2022.12.21 |
[백준] #5597 과제 안 내신 분..? python (0) | 2022.12.21 |
[백준] #1110 std::stoi c++ (0) | 2022.12.21 |