using namespace std; int main() { int y; cin>>y; if((y%400 == 0) || (y%4 == 0 && y%100!=0)) { cout<<"yes"; } else { cout<<"no"; } return 0; }
#include <iostream> using namespace std; int main() { int year; cin >> year; // 判断是否为闰年 if ((year % 4 == 0 && year % 100!= 0) || (year % 100 == 0 && year % 400 == 0)) { cout << "yes"; } else { cout << "no"; } return 0; }
#include #include using namespace std; int main(){ int a; cin>>a; if(a%40&&a%100!=0){ cout<<"yes"; } else if(a%1000&&a%400==0){ cout<<"yes";
}else{ cout<<"no"; } return 0;
}
注册一个 9minute 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 9minute 通用账户