Skip to content

Commit

Permalink
2월 9일 알고리즘
Browse files Browse the repository at this point in the history
  • Loading branch information
sunyeongchoi committed Feb 9, 2021
1 parent 78e3688 commit 7b8d819
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 0 deletions.
7 changes: 7 additions & 0 deletions argorithm/4calculation10869.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
A, B = map(int, input().split())

print(A+B)
print(A-B)
print(A*B)
print(A//B)
print(A%B)
4 changes: 4 additions & 0 deletions argorithm/A+B-3_10950.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
T = int(input())
for i in range(T):
A, B = map(int, input().split())
print(A+B)
12 changes: 12 additions & 0 deletions argorithm/A+B-4_10951.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
while True:
try:
A, B = map(int, input().split())
print(A+B)
except:
break

# import sys

# for line in sys.stdin:
# A, B = map(int, line.split())
# print(A+B)
6 changes: 6 additions & 0 deletions argorithm/A+B-5_10952.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
while True:
A, B = map(int, input().split())
if A+B==0:
break
else:
print(A+B)
16 changes: 16 additions & 0 deletions argorithm/OXquiz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import sys
input = sys.stdin.readline

T = int(input())

for _ in range(T):
ox = list(input().rstrip())
cnt = 1
sum = 0
for index, i in enumerate(ox):
if i == 'O':
sum += cnt
cnt += 1
else:
cnt = 1
print(sum)
2 changes: 2 additions & 0 deletions argorithm/ascii11654.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
str = input()
print(ord(str))
7 changes: 7 additions & 0 deletions argorithm/gugudan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sys
input = sys.stdin.readline

N = int(input())

for i in range(1, 10):
print(f'{N} * {i} = {N*i}')
16 changes: 16 additions & 0 deletions argorithm/min_max10818.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import sys
input = sys.stdin.readline

N = int(input())
nums = list(map(int, input().split()))

min = 1000000
max = -1000000

for num in nums:
if num <= min:
min = num
for num in nums:
if num >= max:
max = num
print(f'{min} {max}')
3 changes: 3 additions & 0 deletions argorithm/number_sum11720.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
N = int(input())
nums = list(map(int, str(input())))
print(sum(nums))
11 changes: 11 additions & 0 deletions argorithm/scale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys
input = sys.stdin.readline

scale = list(map(int, input().split()))

if scale == sorted(scale):
print('ascending')
elif scale == sorted(scale, reverse=True):
print('descending')
else:
print('mixed')
11 changes: 11 additions & 0 deletions argorithm/string_repetition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys
input = sys.stdin.readline

T = int(input())
for i in range(T):
answer = ''
R, S = map(str, input().split())
word = list(S)
for w in word:
answer += str(w)*int(R)
print(answer)
10 changes: 10 additions & 0 deletions argorithm/word_study1157.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from collections import defaultdict

word = list(input().lower())

cnt_dict = defaultdict(int)
for w in word:
cnt_dict[w] += 1

answer = max(cnt_dict.keys(),key=lambda x: cnt_dict[x])
print(answer.upper())
2 changes: 2 additions & 0 deletions argorithm/words_cnt1152.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
words = input().split()
print(len(words))

0 comments on commit 7b8d819

Please sign in to comment.