1 solutions
-
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
Information
- ID
- 17139
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By