1 solutions
-
0
C :
#include <stdio.h> int main() { int n ; scanf("%d" , &n ) ; if( n % 400 == 0 || n % 4 == 0 && n % 100 != 0 ) printf("yes\n") ; else printf("no\n") ; return 0 ; }C++ :
#include<cstdio> #include<iostream> #include<algorithm> 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 in = new Scanner(System.in); int y = in.nextInt(); if(y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)){ System.out.println("yes"); }else{ System.out.println("no"); } } }Python :
# coding=utf-8 year = int(input()) if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0: print("yes") else: print("no")
- 1
Information
- ID
- 16320
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By