Notice
Recent Posts
Recent Comments
Link
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Tags
more
Archives
Today
Total
관리 메뉴

지극히 개인적인 개발블로그

백준 2753: 윤년 (C++) 본문

알고리즘

백준 2753: 윤년 (C++)

코드분쇄기 2019. 9. 13. 18:17

 

#include <iostream>
using namespace std;

int main()
{
	bool ans = false;
	int year;
	cin >> year;

	if ((year % 4 == 0) && (year % 400 == 0 || year % 100 != 0))
		ans = true;
	cout << ans<<endl;
}

 

if식에 조금만 신경쓰면 됩니다.