나를 기록하다
article thumbnail
[백준 2739 파이썬/python] 구구단
Algorithm/baekjoon 2023. 2. 28. 16:37

1) 내가 작성한 코드 N = int(input()) i = 0 while i < 9: i = i + 1 print(('%d * %d = %d'%(N,i,N*i))) 2) 구글링 코드 n = int(input()) for i in range(1,10): # 1~9 print(n, '*', i, '=', n*i)

article thumbnail
[백준 2480 파이썬/python] 주사위 세개
Algorithm/baekjoon 2023. 2. 28. 16:30

1) 내가 작성한 코드 x, y, z = map(int, input().split()) if x==y and y==z: print(10000+1000*x) elif x==y and y!=z: print(1000+100*x) elif y==z and z!=x: print(1000+100*y) elif z==x and x!=y: print(1000+100*z) else: print(max(x,y,z)*100) 2) 클린 코드 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*..

article thumbnail
[백준 2525 파이썬/python] 오븐 시계
Algorithm/baekjoon 2023. 2. 28. 16:25

1) 내가 작성한 코드 hour, minute = map(int, input().split()) time = int(input()) if (hour+(minute+time)//60) = 60: H += 1 M -= 60 if H >= 24: H -= 24 print(H,M)

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

profile on loading

Loading...