1 条题解
-
0
C :
#include <stdio.h> int main() { int year, leap; scanf("%d", &year); leap = 0; //0表示非闰年 if(year % 4 == 0){ if(year % 100 != 0) leap = 1; } if(year % 400 == 0) leap = 1; if(leap) printf("Yes\n"); else printf("No\n"); return 0; }C++ :
#include<iostream> using namespace std; int main() { int y; cin>>y; if (y%4==0&&y%100!=0||y%400==0) cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }Pascal :
program Jerry001; var a:integer; begin readln(a); if (a mod 4=0) and (a mod 100<>0) then writeln('Yes') else if a mod 400=0 then writeln('Yes') else writeln('No'); end.
- 1
信息
- ID
- 1876
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者