[25304] 영수증 total = int(input()) count = int(input()) lists = [] sums = 0 for i in range(count): lists.append(list(map(int, input().split()))) for i in range(count): sums = sums + lists[i][0] * lists[i][1] if sums == total : print("Yes") else: print("No") 코딩 테스트 준비하기/백준 - 반복문 2023.06.29
[2480] 주사위 세개 dice = list(map(int, input().split())) dice2 = set(dice) if len(dice2) == 1: print(10000 + dice[0] * 1000) elif len(dice2) == 2: counts = dice[0] if dice.count(dice[0]) > dice.count(dice[1]) else dice[1] print(1000 + counts * 100) else: print(max(dice2) * 100) 코딩 테스트 준비하기/백준 - 조건문 2023.06.28
[2525] 오븐시계 H, M = map(int, input().split()) time = int(input()) difference = (M + time) // 60 rest = (M + time) % 60 if difference >= 1: if H + difference >= 24: print(H + difference - 24, rest) else: print(H + difference, rest) else: print(H, M + time) 코딩 테스트 준비하기/백준 - 조건문 2023.06.28
[2884] 알람시계 H, M = map(int, input().split()) if(M- 45 >= 0) : print(H,M-45) else: if H == 0 : print(23,M-45+60) else: print(H-1,M-45+60) 코딩 테스트 준비하기/백준 - 조건문 2023.06.28
[14681] 사분면 고르기 X = int(input()) Y = int(input()) x = '+' if X > 0 else '-' y = '+' if Y > 0 else '-' if (x=='+' and y=='+') : print("1") elif (x=='+' and y=='-') : print("4") elif (x=='-' and y=='+') : print("2") elif (x=='-' and y=='-') : print("3") 코딩 테스트 준비하기/백준 - 조건문 2023.06.28
[2753] 윤년 year = int(input()) if((year % 4 == 0 and year % 100 != 0)or(year % 4 == 0 and year % 400 == 0)) : print(1) else: print(0) 코딩 테스트 준비하기/백준 - 조건문 2023.06.28
[1330] 두 수 비교하기 A, B = map(int, input().split()) end = '>' if A>B else ' 코딩 테스트 준비하기/백준 - 조건문 2023.06.28