//Java版代码 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String start = sc.next(); String end = sc.next(); int startYear = Integer.parseInt(start.substring(0, 4)); int startMonth = Integer.parseInt(start.substring(4, 6)); int startDay = Integer.parseInt(start.substring(6, 8)); int endYear = Integer.parseInt(end.substring(0, 4)); int endMonth = Integer.parseInt(end.substring(4, 6)); int endDay = Integer.parseInt(end.substring(6, 8)); int[] days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int totalDay = 0; while (startYear < endYear || startYear == endYear && startMonth < endMonth || startYear == endYear && startMonth == endMonth && startDay <= endDay) { if (startYear % 4 == 0 && startYear % 100 != 0 || startYear % 400 == 0) days[2] = 29; else days[2] = 28; startDay++; totalDay++; if (startDay > days[startMonth]) { startDay = 1; startMonth++; if (startMonth > 12) { startMonth = 1; startYear++; } } } System.out.println(totalDay); } } #Python版代码 from datetime import datetime start_time = datetime.strptime(input(), '%Y%m%d') end_time = datetime.strptime(input(), '%Y%m%d') print((end_time - start_time).days + 1)