闰年问题
这是我的代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int year;
cin>>year;
if(year%4==0&&year%100!=0&&year%400==0){
cout<<"YES";
}
if(year%4==0&&year%100==0&&year%400==0){
cout<<"YES";
}
if(year%4==0&&year%100==0&&year%400!=0){
cout<<"NO";
}
if(year%4==0&&year%100!=0&&year%400!=0){
cout<<"YES";
}
if(year%4!=0&&year%100==0&&year%400!=0){
cout<<"NO";
}
if(year%4!=0&&year%100!=0&&year%400!=0){
cout<<"NO";
}
return 0;
}
请问有什么办法能最简简化代码?