#include <iostream> using namespace std; int daysTable[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; bool isLeapYear(int year) { if (year % 4 == 0 && year % 100 != 0) return true; if (year % 400 == 0) return true; return false; } int pastDaysOfAYear(int year, int month, int day) { int ans = 0; for (int i = 1; i < month; i++) { ans += daysTable[isLeapYear( year)][i]; } ans += day; return ans; } int main() { int a, b; while (cin >> a >> b) { // 注意 while 处理多个 case // cout << a + b << endl; int a_year = a / 10000; int a_month = (a % 10000) / 100; int a_day = a % 100; int b_year = b / 10000; int b_month = (b % 10000) / 100; int b_day = b % 100; int range = 0; for (int i = a_year; i < b_year; i++) { if (isLeapYear(i)) range += 366; else range += 365; } range -= pastDaysOfAYear(a_year, a_month, a_day); range += pastDaysOfAYear(b_year, b_month, b_day); cout << range + 1 << endl; } } // 64 位输出请用 printf("%lld")