_won_
wonprogrammer
_won_
전체 방문자
오늘
어제
  • 분류 전체보기
    • woncoding
      • TIL
      • WIL
    • source Code
      • Python
      • Programmers
      • BAEKJOON

블로그 메뉴

  • 방명록

티스토리

Github · Wonprogrammer
hELLO · Designed By 정상우.
_won_

wonprogrammer

source Code/BAEKJOON

BAE/<JOON> | 1차원 배열

2022. 9. 6. 21:47

1. [avg_program_1546.py]

tc = int(input())

score = list(map(int,input().split()))
score.sort()
max_score = score[-1]

sum = 0

for s in score :
    s = s/max_score*100
    sum = sum + s

print(sum / tc)

 

 

 

 

 

2. [max_arr_2562.py]

num_list = []

for i in range(9):
    num = int(input())
    num_list.append(num)

small = 0

for n in num_list:
    if small < n:
        small = n



print(small)
print(num_list.index(small) + 1)

 

 

 

 

 

3. [OX_sum_8958.py]

tc = int(input())

for t in range(tc) :
    case = list(input())
    sum = 0
    total_sum = 0

    for c in case :
        if c == 'O' :
            sum += 1
            total_sum = total_sum + sum
        else:
            sum = 0

    print(total_sum)


 

 

 

 

 

4. [set_arr_3052.py]

num_di_list =[]

for tc in range(10) :
    num = int(input())
    num_di = num % 42
    num_di_list.append(num_di)

divi = 0

count = 0

num_di_list_set = set(num_di_list)

print(len(num_di_list_set))

 

 

 

 

 

 

 

5. [avg_per_score_4344.py]

tc = int(input())

score_sum = 0

for t in range (tc) :
    member_score = list(map(int, input().split()))

    avg_score = sum(member_score[1:]) / member_score[0]
    count = 0

    for score in member_score[1:]:
        if score > avg_score:
            count += 1

    avg_percent = (count / member_score[0]) * 100

    print(f'{avg_percent:.3f}%')

'source Code > BAEKJOON' 카테고리의 다른 글

BAE/<JOON> | 반복문  (0) 2022.09.05
BAE/<JOON> | 조건문  (0) 2022.09.05
BAE/<JOON> | 입력과 사칙연산  (0) 2022.09.01
    'source Code/BAEKJOON' 카테고리의 다른 글
    • BAE/<JOON> | 반복문
    • BAE/<JOON> | 조건문
    • BAE/<JOON> | 입력과 사칙연산
    _won_
    _won_
    Coding Practice blog

    티스토리툴바