Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 5, 2020 18:55
Show Gist options
  • Save kryvoboker/607b201f0de524f6a07ca6243168421d to your computer and use it in GitHub Desktop.
Save kryvoboker/607b201f0de524f6a07ca6243168421d to your computer and use it in GitHub Desktop.
HomeWork3
import java.util.Scanner;
/**
*
* @author kamaz
*/
public class Main {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Input year");
int b = sc.nextInt();
int c = 0;
if (((b*100%100) == 0) && ((b%4) > 0)) {
c = 365;
}
if (((b*100%400) == 0) && ((b%4) == 0)) {
c = 366;
}
System.out.println(c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment