竞赛
考级
法西斯玫瑰
解
徐晨轩
#include<iostream> using namespace std; int main(){ int n; cin >> n; if(n%40&&n%100!=0||n%4000&&n%4==0 ) { cout << "KeYi"; } else { cout << "BuKeYi"; } return 0; }
哪吒
#include<iostream> using namespace std; int main(){ int year; cin>>year; if(year%4 == 0 && year%100 != 0 || year%400 == 0){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } return 0; }
爱编程的人
137****0580
定义变量再输入,一层模四看整除。模了一百看四百,判断完了就输出。 诗文大意:(定义年份变量a,第一层判断看能否模四(四年一闰),第二层判断是否能模一百(百年不闰),不过第二层之后还有第三层——判断能否模四百(四百年再闰)。可以就输出对,不可以输出不对。不过这个时候不百年一闰的情况(四年一闰)又判断不了了,于是要在第二层判断后加个else,输出对,结束。
WA四十AC八十——八十!八十!
#include<bits/stdc++.h> 2 using namespace std; 3 int main(){ 4 int year; 5 cin>>year; 6 if((year%40&&year%100!=0)||year%4000) 7 { 8 cout<<"Y"<<endl; 9 } 10 else 11 cout<<"N"<<endl; 12 return 0; 13 }
<TNT><G>Greating
#include<iostream> using namespace std; int main(){ int n; cin>>n; if(n%40&&n%100!=0||n%4000){ cout<<"Y"; } else{ cout<<"N"; } return 0; }
崔 z y
#include <iostream> using namespace std; int main(){ int year; cin >> year; if (year%40 and year%100!=0 or year%4000){ cout << "Y"; }else{ cout << "N"; } return 0; }
AndyEggy
#include<iostream> using namespace std; int main(){ int n; cin >> n; if(n%40&&n%100!=0||n%4000){ cout << "Y"; }else{ cout<<"N"; } return 0; }
Black Myth:悟空
#include<iostream> using namespace std; int main() { int a = 0; cin >> a; if (a%40&&a%100!=0) { cout << "Y" ; } else if(a%4000) { cout<<"Y"; } else { cout << "N" ; } return 0; }
181****9989
#include <iostream> using namespace std; int main(){ int a; cin>>a; if(a%40&&a%100!=0||a%4000){//简单到爆炸的判断 cout<<"Y"; }else{ cout<<"N"; } return 0; }
背刺王冥河
#include<iostream> using namespace std; int main(){ int a; cin>>a; if(a%40&&a%100!=0||a%4000) cout<<"Y"; else cout<<"N"; }
名字一共八个字符
#include<iostream> using namespace std; int main(){ int n; cin>>n; if(n%4000 || n%40 && n%100!=0){ cout<<"Y"; }else{ cout<<"N"; } }
juhan214
#include<iostream> #include <algorithm> #include <bits/stdc++.h> #include <math.h> #include <cmath> #include<string> #include<cstring> #include<list> #include<map> #include<queue> #include<iterator> #include<stack> using namespace std; int main(){ int a; cin>>a; if(a%4 == 0 && a%100 != 0 || a%400 == 0){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } return 0; }
Addicted to C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n%4 == 0){ if(n%100 == 0){ if(n%400 == 0){ cout<<"Y"; }else { cout<<"N"; } }else { cout<<"Y"; } }else { cout<<"N"; } return 0; }加粗文本
复仇者_澜
#include<iostream> using namespace std; int main(){ int a; cin>>a; if(a%40&&a%100!=0||a%4000){ cout<<"Y"; } else{ cout<<"N"; } return 0; }
DEMO
「欢愉」花火
#include<iostream> using namespace std; int main() { int y; cin >> y; if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) { cout << "Y" << endl; } else { cout << "N" << endl; } return 0; } //闰年的条件是:一:能被4整除,但不能被100整除的年份 (例如2008是闰年,1900不是闰年) //二:能被400整除的年份 (例如2000年)也是闰年。 // ——万年历
葬仪_亡蝶舞
135****0149
共124条