1 solutions
-
0
C :
#include<stdio.h> int main(){ int n; scanf("%d",&n); if(n%4==0 && n%100!=0 || n%400==0){ printf("yes"); }else{ printf("no"); } return 0; }
C++ :
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n%4==0&&n%100!=0||n%400==0)cout<<"yes"<<endl; else cout<<"no"<<endl; return 0; }
Java :
import java.util.Scanner; public class Main { public static void main(String[] Args) { Scanner sc = new Scanner(System.in); int year = sc.nextInt(); int a = 0; if(year%400==0) a=1; else { if(year%4==0&&year%100!=0) a=1; else a=0; } if(a==1) { System.out.println("yes"); } else { System.out.println("no"); } } }
Python :
n=int(input()) if n%4==0 and n%100!=0 or n%400==0: print('yes') else: print('no')
- 1
Information
- ID
- 10235
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By