Thinking/BAEKJOON
C++ BAEKJOON 2753번 윤년
Dev_카페인
2022. 8. 17. 02:08
반응형
[C++] BAEKJOON 2753번 : 윤년
if 안에 if 안에 if 를 잘 해석해 보자
#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
bool y = false;
if (a % 4 == 0) {
y = true;
if (a % 100 == 0) {
y = false;
if (a % 400 == 0) {
y = true;
}
}
}
cout << y << endl;
}
반응형