본문 바로가기
Algorithm

Baekjoon - if

by Jiseong 2021. 5. 30.

[1330]

a, b = map(int, input().split())
if a > b : print(">")
elif a < b : print("<")
else: print("==")

 

 

[9498]

score = int(input())

if 90 <= score <= 100:
    print("A")
elif 80 <= score <= 89:
    print("B")
elif 70 <= score <= 79:
    print("C")
elif 60 <= score <= 69:
    print("D")
else:
    print("F")

 

[2753]

year = int(input())

if year % 4 == 0 and year  % 100 != 0 or year % 400 == 0:
    print("1")
else:
    print("0")

 

[14681]

x = int(input())
y = int(input())

if x > 0 and y > 0:
    print("1") 
elif x < 0 and y > 0:
    print("2")
elif x < 0  and y < 0:
    print("3")
else:
    print("4")

 

[2884]

H, M = map(int, input().split())
t = (H * 60) + M
if M < 45:
    if H == 0:
        H = 23
        M = 60 + (M - 45)
        print(H, M)
    else:
        H = H - 1
        M = 60 + (M - 45)
        print(H, M)
else:
    M = M - 45
    print(H, M)

 

'Algorithm' 카테고리의 다른 글

Baekjoon - while  (0) 2021.05.30
Baekjoon - for  (0) 2021.05.30
[Codeup] Python 기초 100제(6)  (0) 2021.05.27
[Codeup] Python 기초 100제(5)  (0) 2021.05.26
[Codeup] Python 기초 100제(4)  (0) 2021.05.25

댓글