@java blue bridge group B Problem Fundamentals cup (30) a first question: Analyzing leap year

@java blue bridge group B Problem Fundamentals cup (30) a first question: Analyzing leap year

Keywords: conditional

Problem Description:

Given a year to determine the year is not a leap year.
When one of the following conditions are met this year is a leap year:

  1. Year is a multiple of 4 but not multiple of 100;
  2. Year is a multiple of 400.
    Other years are not leap years.
    Input format
    input contains an integer y, it represents the current year.
    Output format
    output line, if the given year is a leap year, the output yes, otherwise output no.
    Note: When you export a string of questions specified as a result (such as this question yes or no, you need to strictly follow the questions in a given case, wrong case will not score points.

Sample Input
2013
Sample Output
no
sample input
2016
Sample Output
yes
the data size of the agreed
1990 <= y <= 2050.

Code:

import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int x=s.nextInt();
if(x>=1990&x<=2050){
if(x%4000||x%4! 0 & 100% = X 0) {
System.out.println ( "Yes");
}
the else {
System.out.println ( "NO");
}
}
the else {
System.out.println ( "data size and Conventions: 1990 <= Y <= 2050 ");
}
}

}

Published 29 original articles · won praise 1 · views 1105

Guess you like

Origin blog.csdn.net/DAurora/article/details/104154514