TIL25.algorithm 기초

Jaeyeon·2021년 2월 26일
0
post-thumbnail

전자렌지

a = int(input())
if a % 10 == 0:
    print(a // 300, (a % 300)//60, (a%300)%60//10)
else:
    print(-1)

방학숙제

import math
a= int(input())
b= int(input())
c= int(input())
d= int(input())
e= int(input())
b1 = math.ceil(b/d)		#math.ceil = 올림
c1 = math.ceil(c/e)
print(a - max(b1,c1))

삼각형 외우기

v=[]
for i in range(3):
    a = int(input())
    v.append(a)
v.sort()
if v[0] == v[1] == v[2]:
    print('Equilateral')
elif v[0]+v[1]+v[2] == 180 and (v[0] == v[1] or v[1] == v[2]):
    print("Isosceles")
elif v[0]+v[1]+v[2] == 180 and v[0] != v[1] != v[2]:
    print("Scalene")
else:
    print("Error")

수도요금

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
if e-c<=0:
    print(min(a*e,b))
else:
    print(min(a*e,b+d*(e-c)))

생각을 좀 한 문제

시험점수

a = map(int,input().split())
b = map(int,input().split())
v1= sum(a)
v2= sum(b)
if v1 == v2:
    print(v1)
else:
    print(max(v1,v2))

파일 옮기기

a,b = map(int,input().split())
c,d = map(int,input().split())
print(min(a+d,b+c))

티비 크기

d, h, w = map(int, input().split())
r = d / ((h ** 2 + w ** 2) ** 0.5)
print(int(h * r), int(w * r))

구글 검색

profile
생각하는 개발자 되기

0개의 댓글