Sprint를 나가는 날에는 백준의 Python 배우기(1~50)문제집을 풀려고 한다. 하루종일 코드를 잡고있다보니 생각이 지나치게 많이 필요한 문제는 부담이 되는 것 같다고 생각했기 때문이다. 물론 적응될수록 난이도를 올려갈 것이다. 차근차근 습관을 만들어가보자
백준 2935번 소음
A = int(input())
yeon = input()
C = int(input())
if yeon == '*':
result = A*C
elif yeon == '+':
result = A+C
print(result)
백준 10817번 세 수
A,B,C = map(int,input().split())
result_max = max(A,B,C)
if A==result_max:
if B>C:
result = B
else:
result = C
if B==result_max:
if A>C:
result = A
else:
result = C
if C==result_max:
if A>B:
result = A
else:
result = B
print(result)
백준 1789번 수들의 합
S = int(input())
count = 0
result = 0
while True:
count +=1
result += count
if result > S:
break
print(count-1)
백준 10039번 평균 점수
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
if A<40:
A = 40
if B<40:
B = 40
if C<40:
C = 40
if D<40:
D = 40
if E<40:
E = 40
print(int((A+B+C+D+E)/5))
백준 1934번 최소공배수
from math import gcd
T = int(input())
for i in range(T):
A,B = map(int,input().split())
print(int(A*B/gcd(A,B)))
백준 2480번 주사위 세개
A,B,C = map(int,input().split())
if A==B and B==C:
result = 10000+A*1000
elif A==B and B!=C:
result = 1000+A*100
elif A!=B and B==C:
result = 1000+B*100
elif A==C and B!=C:
result = 1000+A*100
else :
result = max(A,B,C)*100
print(result)
백준 4101번 크냐?
while True:
A,B = map(int,input().split())
if A==0 and B==0:
break
else:
if A>B:
print('Yes')
else:
print('No')