import java.util.GregorianCalendar;import java.util.Scanner;public class Main{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); while(scan.hasNext()) { int sum = 0; int arrMonth[][] = {{0},{31},{28},{31},{30},{31},{30},{31},{31},{30},{31},{30}}; String arr[] = scan.nextLine().split("/"); int year = Integer.parseInt(arr[0]); int month = Integer.parseInt(arr[1]); int day = Integer.parseInt(arr[2]); sum = day; GregorianCalendar c = new GregorianCalendar(); if(year%4==0&&year%100!=0||year%400==0){ if(month>2) sum++; } for(int i=1; i<month; ++i) { sum += arrMonth[i][0]; } System.out.PRintln(sum); } }}
新闻热点
疑难解答