나를 기록하다
article thumbnail
반응형

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

나를 기록하다

@prao

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

profile on loading

Loading...