Problem4593--闰年判断

4593: 闰年判断

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

输入一个年份n(大于1582的整数),判断这一年是否为闰年,如果是输出1,否则输出0

非整百年,可以被4整除的年份是闰年(如2012年),

整百年,能被400整除的年份是闰年(如2000年),

其他年份都不是闰年(比如1900)。

#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    if (            ) {
        if (             ) cout << 1;
        else cout << 0;
    } else {
        if (             ) cout << 1;
        else cout << 0;
    }
    return 0;
}

Sample Input Copy

2024

Sample Output Copy

1

Source/Category