闰年:(y % 4 == 0 && y % 100 != 0) || y % 400 == 0
package org.niuke.solution34; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] date = new int[]{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}; while (sc.hasNext()) { int y = sc.nextInt(), m = sc.nextInt(), d = sc.nextInt(); if((y % 4 == 0 && y % 100 != 0) || y % 400 == 0){ System.out.println(date[m - 1] + d + 1); }else{ System.out.println(date[m - 1] + d); } } } }