Go: package main

import (
	"bufio"
		"os"
	"strings"
	"strconv"
		"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), " ")
		ele_t1 := [3]int{}
		ele_t2 := [3]int{}
		for i := range ele_t1 {
			ele_t1[i], _ = strconv.Atoi(input[i])
			ele_t2[i], _ = strconv.Atoi(input[i+3])
		}
		if ele_t1[0] < 0 || ele_t1[1] < 0 || ele_t1[2] < 0 ||
			ele_t2[0] < 0 || ele_t2[1] < 0 || ele_t2[2] < 0 {
				break
		}
		// t1 := time.Date(ele_t1[0], time.Month(ele_t1[1]), ele_t1[2], 0, 0, 0, 0, time.UTC)
		// t2 := time.Date(ele_t2[0], time.Month(ele_t2[1]), ele_t2[2], 0, 0, 0, 0, time.UTC)
		// diff := t2.Sub(t1)
		// fmt.Printf("%v\n", int64(diff/(time.Hour*24)))
		fmt.Println(ut2jd(ele_t2[0], ele_t2[1], ele_t2[2])-ut2jd(ele_t1[0], ele_t1[1], ele_t1[2]))
	}
}

func ut2jd(year, month, day int) int {
	if month <= 2 {
		year--
		month += 12
	}
	s := 3 + year/4 - year/100 + year/400
	s += 1720994 + year*365 + (month+1)*30 + (month+1)*3/5 + day
	return s
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;

int mm1[] = {0,31,59,90,120,151,181,212,242,273,303,334};
int mm2[] = {0,31,60,91,121,152,182,213,243,274,304,335};
// ¼ïPNPPú©çÌú
ll days(int y, int m, int d) {
  y--;
  ll ret = y*365;
  ret += (y/4)-(y/100)+(y/400); // [N
  if (y%400==0||(y%4==0&&y%100==0))
    ret += mm1[m-1];
  else
    ret += mm2[m-1];
  return ret+d;
}

int main() {
  int y1,m1,d1,y2,m2,d2;
  while(cin>>y1>>m1>>d1>>y2>>m2>>d2) {
    if (y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break;
    cout << days(y2,m2,d2)-days(y1,m1,d1) << endl;
  }
}

C++: #include <cstdio>
bool isLeap(int year)
{
	if (year % 400 == 0) return true;
	if (year % 100 == 0) return false;
	return (year % 4 == 0);
}
long long dateserial(int year, int month, int day)
{
	static int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	long long res = day;
	for (int i = 0; i < month; ++i) {
		res += days[i];
		if (isLeap(year) && i == 1) res++;
	}
	for (int i = 2; i < year; ++i) {
		res += 365;
		if (isLeap(i)) res++;
	}
	return res;
}
int main()
{
	while (true) {
		int y1, m1, d1, y2, m2, d2;
		scanf("%d%d%d%d%d%d", &y1, &m1, &d1, &y2, &m2, &d2);
		if (y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;

		long long date1 = dateserial(y1, m1, d1);
		long long date2 = dateserial(y2, m2, d2);
		printf("%d\n", date2 - date1);
	}
	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

constexpr int fairfield(int y, int m, const int &d) {
  if (m == 1 || m == 2) y--, m += 12;
  return 365 * y + y / 4 - y / 100 + y / 400 + 306 * (m + 1) / 10 + d - 428;
}

void solve() {
  int y1, m1, d1, y2, m2, d2;
  while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2, y1 != -1) {
    cout << fairfield(y2, m2, d2) - fairfield(y1, m1, d1) << endl;
  }
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    for(;;){
        int y[2], m[2], d[2];
        for(int i=0; i<2; ++i){
            cin >> y[i] >> m[i] >> d[i];
            if(y[i] < 0 || m[i] < 0 || d[i] < 0)
                return 0;
        }

        int sum[2] = {0};
        for(int i=0; i<2; ++i){
            for(int j=1; j<y[i]; ++j){
                sum[i] += 365;
                if(j % 400 == 0 || (j % 100 != 0 && j % 4 == 0))
                    ++ sum[i];
            }
            for(int j=1; j<m[i]; ++j){
                sum[i] += month[j];
                if(j == 2 && (y[i] % 400 == 0 || (y[i] % 100 != 0 && y[i] % 4 == 0)))
                    ++ sum[i];
            }
            sum[i] += d[i];
        }

        cout << (sum[1] - sum[0]) << endl;
    }
}

C++: // Tazoe

#include <iostream>
using namespace std;

int main()
{
while(true){
	int y1, m1, d1, y2, m2, d2;
	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0)  break;
	int sum = 0;
	for(int i=y1; i<y2; i++){
		sum += 365;

		if(i%400==0||(i%100!=0&&i%4==0)){
			sum++;
		}
	}

	const int M[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	for(int i=1; i<m2; i++){
		sum += M[i-1];

		if(i==2&&(y2%400==0||(y2%100!=0&&y2%4==0))){
			sum++;
		}
	}
	sum += d2;

	for(int i=1; i<m1; i++){
		sum -= M[i-1];

		if(i==2&&(y1%400==0||(y1%100!=0&&y1%4==0))){
			sum--;
		}
	}
	sum -= d1;

	cout << sum << '\n';
}
	return 0;
}

C++: #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

int month[]={
  0,
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    base+=365
    if ( i %400 == 0 ||
	 (i % 100 !=0 && i % 4 == 0))base++;
  }
  return base;
}



/*
  correct version
int day(int y,int m,int d){
  y += 4800;
  if (m < 3) --y, m += 12;
  return 365L*y+y/4-y/100+y/400+(153*m-457)/5+d-32045;
}
*/

main(){
  int y1,m1,d1,y2,m2,d2;
  while(cin>>y1>>m1>>d1>>y2>>m2>>d2 ){
    if ( y1 < 0 || m1 < 0 || d1 < 0 || 
	 y2 < 0 || m2 < 0 || d2 < 0)break;
    int a=day(y1,m1,d1),b=day(y2,m2,d2);
    cout << b-a << endl;
  }
}

C++: #include <iostream>
using namespace std;int day(int y,int m,int d){
    int i,i2,ans=0;
    for(i=1;i<y;i++){
        if(i%4==0&&(i%100!=0||i%400==0))ans+=366;
        else ans+=365;
    }
    for(i=1;i<m;i++){
        if(i==4||i==6||i==9||i==11)ans+=30;
        else if(i==2){
            if(y%4==0&&(y%100!=0||y%400==0))ans+=29;
            else ans+=28;
        }
        else ans+=31;
    }
    ans+=d;
    return ans;
}
int main(void){
    int y1,y2,m1,m2,d1,d2;
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    while(y1!=-1){
        cout<<abs(day(y1,m1,d1)-day(y2,m2,d2))<<endl;
        cin>>y1>>m1>>d1>>y2>>m2>>d2;
    }
return 0;
}