카테고리 없음

백준 3003번 다른 코드

즐기는 마인드 2022. 8. 19. 13:53
A =int(input())
if (A % 4) != 0:
    print('0')
elif (A % 4 == 0) and (A % 400 == 0):
    print('1')
elif (A % 4 == 0) and (A % 100 == 0):
    print('0')
else:
    print('1')

내 코드인데 넘 길다

 

줄이면

A = int(input())

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

로 수정 가능하다