package com.codegym.task.task04.task0414;
/*
Number of days in the year
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
String numy =bf.readLine();
int numi=Integer.parseInt(numy) ;
checkYear(numi);
}
public static void checkYear(int numi){
int y = numi%400 ;
int x = numi%4 ;
int z = numi%100;
if ((x==0)||(y==0&&z!=0) ) System.out.println("Number of days in the year: "+366) ;
else
System.out.println("Number of days in the year:"+365) ;
}
}
can you see my wrong code?
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Hendra
5 December 2019, 17:48
thanks for helping
0
Anthony Chalk
5 December 2019, 17:34
should be
Also, you need a space between the colon and 365
0