나를 기록하다
article thumbnail
[백준 2884 파이썬/python] 알람 시계
Algorithm/baekjoon 2023. 2. 28. 16:23

hour, min = map(int,input().split()) if min >= 45: print(hour, min-45) elif hour > 0 and min < 45: print(hour-1, min+15) else: print(23, min+15) // 결과 // 입력값 10 10 // 출력값 9 25 // 입력값 0 30 // 출력값 23 45

article thumbnail
[백준 14681 파이썬/python] 사분면 고르기
Algorithm/baekjoon 2023. 2. 28. 16:22

x = int(input()) y = int(input()) if x > 0 and y > 0: print('1') elif x 0 > y: print('4') // 결과 // 입력값 1 1 // 출력값 1 // 입력값 -1 -1 // 출력값 3

article thumbnail
[백준 2753 파이썬/python] 윤년
Algorithm/baekjoon 2023. 2. 28. 16:20

1) 첫 번째 코드 year = int(input()) if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): print(1) else: print(0) 2) 두 번째 코드 year = int(input()) print('1') if ((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0) else print('0') 3) 결과 // 결과 // 입력값 2000 // 출력값 1 // 입력값 1999 // 출력값 0

article thumbnail
[백준 9498 파이썬/python] 시험 성적
Algorithm/baekjoon 2023. 2. 28. 16:11

score = int(input()) if score >= 90: print('A') elif score >= 80: print('B') elif score >= 70: print('C') elif score >= 60: print('D') else: print('F') // 결과 100 A 82 B 32 F

article thumbnail
[백준 1330 파이썬/python] 두 수 비교하기
Algorithm/baekjoon 2023. 2. 27. 19:36

A, B = map(int, input().split()) if A > B: print(">") elif A < B: print("

article thumbnail
[백준 10172 파이썬/python] 개
Algorithm/baekjoon 2023. 2. 27. 19:34

1) [오답] 내가 작성한 코드 print("|\\\\_/|") print("|q p| /}") print("( 0 )\\"\\"\\"\\\\") print("|\\"^\\"' |") print("||_/=\\\\\\\\__|") |\\_/| |q p| /} ( 0 )"""\\ |"^"' | ||_/=\\\\__| 2) [정답] 정답 코드 print("|\\_/|") print("|q p| /}") print('( 0 )"""\\\\') # \\'앞에 \\을 붙여준다. print('|"^"` |') print("||_/=\\\\\\__|") # \\\\ 앞에 \\을 하나 더 붙여준다. |\\_/| |q p| /} ( 0 )"""\\ |"^"` | ||_/=\\\\__| → 틀린 이유 ` 특수기호를 이용해..

profile on loading

Loading...