Skip to content

Commit

Permalink
[#3] 2021.12.15 백준단계별4. 일차원 배열
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesuuou committed Dec 15, 2021
1 parent 03968b4 commit 5d38a1c
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Boj/1차원 배열/10818.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
n = int(input())
num = list(map(int, input().split()))
max = num[0]
min = num[0]

for i in range(0, n):
if max < num[i]:
max = num[i]
elif min > num[i]:
min = num[i]

print(min, max)
19 changes: 19 additions & 0 deletions Boj/1차원 배열/1546.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
n = int(input())
data = list(map(int, input().split()))

# 최고값 찾기
m = 0
for i in data:
if m < i:
m = i

# 새로운 점수
for i in range(0, len(data)):
data[i] = (data[i]/m) * 100

# 새로운 평균
sum = 0
for i in data:
sum = sum + i

print(sum / len(data))
10 changes: 10 additions & 0 deletions Boj/1차원 배열/2562.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
maxIdx = 0
max = 0
for i in range(1, 10):
a = int(input())
if a > max:
max = a
maxIdx = i

print(max)
print(maxIdx)
18 changes: 18 additions & 0 deletions Boj/1차원 배열/2577.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
a = int(input())
b = int(input())
c = int(input())

number = []
answer = []

for i in str(a*b*c):
number.append(int(i))

for i in range(0, 10):
answer.append(0)

for i in number:
answer[i] = answer[i] + 1

for i in range(0, 10):
print(answer[i])
10 changes: 10 additions & 0 deletions Boj/1차원 배열/3052.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
data = []
for _ in range(10):
data.append(int(input()))

for i in range(0, 10):
data[i] = data[i] % 42

data = list(set(data))

print(len(data))
17 changes: 17 additions & 0 deletions Boj/1차원 배열/4344.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
c = int(input())

for i in range(c):
score = list(map(int, input().split()))
#index 0은 학생수, 이후 점수
sum = 0

# 평균구하기
for j in range(1, score[0] + 1):
sum = sum + score[j]
ave = sum / score[0]

n = 0 #평균넘은학생수
for j in range(1, score[0]+1):
if ave < score[j]:
n = n+1
print(format(n/score[0]*100,".3f")+ "%")
17 changes: 17 additions & 0 deletions Boj/1차원 배열/8958.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
n = int(input())

for i in range(0, n):
ans = 0 # 총점
tmp = 0
data = input()
data = list(data)


for j in range(len(data)):
if data[j] == 'O':
tmp = tmp+1
ans = ans + tmp
else:
tmp = 0

print(ans)

0 comments on commit 5d38a1c

Please sign in to comment.