백준 2단계 - Python

jhyngu·2023년 1월 12일
0

백준

목록 보기
2/12

2단계 - 조건문

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):
  print("B")
elif (70<=score):
  print("C")
elif (60<=score):
  print("D")
else:
  print("F")

2753 윤년

a = int(input())

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

14681 사분면 고르기

a=int(input())
b=int(input())
if(a>0 and b>0):
  print('1')
elif(a<0 and b>0):
  print('2')
elif(a<0 and b<0):
  print('3')
else:
  print('4')

2884 알람 시계

h, m = map(int,input().split())

if m >= 45:
  print(h,m-45)
elif h>0 and m<45:
  print(h-1,m+15)
else:
  print(23,m+15)

2525 오븐 시계

a, b = map(int,input().split())
c = int(input())

a += c // 60
b += c % 60

if b>=60:
  a += 1
  b -= 60
if a>=24:
  a -= 24

print(a, b)

2480 주사위 세개

a, b, c = map(int,input().split())

if a == b == c:
  print(10000+a*1000)
elif a == b:
  print(1000+a*100)
elif a == c:
  print(1000+a*100)
elif b == c:
  print(1000+b*100)
else:
  print(100*max(a,b,c))

0개의 댓글