1 solutions
-
0
C :
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> int main() { // freopen("in","r",stdin); // freopen("out","w",stdout); int year, flag; while(scanf("%d",&year )!=EOF){ if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { flag = 1; } else { flag = 0; } if (flag) { printf("Yes\n"); } else { printf("No\n"); } } return 0; }C++ :
#include <cstdio> int main() { int n; while (scanf("%d", &n) != EOF) { if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) printf("Yes\n"); else printf("No\n"); } }Pascal :
program ex_1; var a,b,c:integer; begin while not eof do begin readln(a); if (a mod 4=0) and (a mod 100<>0) or (a mod 400=0) then writeln('Yes') else writeln('No'); end; end.
- 1
Information
- ID
- 18151
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By