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>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int cal[100000];
	int month[13];
	month[1]=month[3]=month[5]=month[7]=month[8]=month[10]=month[12]=31;
	month[4]=month[6]=month[9]=month[11]=30;
	loop(i,0,100000){
		if(i%4==0){
			if(i%100==0){
				if(i%400==0){
					cal[i]=1;
				}else cal[i]=0;
			}else cal[i]=1;

		}else cal[i]=0;
	}
	int ay,am,ad,by,bm,bd;
	while(1){
		cin>>ay>>am>>ad>>by>>bm>>bd;
		if(ay<0 || am<0 || ad<0 || by<0 || bm<0 || bd<0)break;
		long long ans=0;
		loop(j,ay+1,by){
			if(cal[j]==1){
				ans+=366;
			}else ans+=365;
		}
		if(ay!=by){
			loop(j,am+1,13){
				if(j==2){
					if(cal[ay]=1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
			loop(j,1,bm){
				if(j==2){
					if(cal[by]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}else{
			loop(j,am+1,bm){
				if(j==2){
					if(cal[am]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}
		if(am!=bm){
			if(am==2){
				if(cal[ay]==1)ans+=(29-ad);
				else ans+=(28-ad);
			}else{
				ans+=(month[am]-ad);
				ans+=bd;
			}
		}else if(ay==by){
			ans+=(bd-ad);
		}else{
			if(am==2){
				if(cal[ay]==1)ans+=(29-ad);
				else ans+=(28-ad);
			}else{
				ans+=(month[am]-ad);
				ans+=bd;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int pm(int y, int m) {
    int sum = 0;
    int s[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for (int i = 0; i < m - 1; i++) {
        sum += s[i];
        if (i == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) sum += 1;
    }
    return sum;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2,
           y1 > -1 && y2 > -1 && m1 > -1 && m2 > -1 && d1 > -1 && d2 > -1) {
        y1--;
        int t1 = y1 * 365 + (y1 / 400) - (y1 / 100) + (y1 / 4);
        y1++;
        t1 += d1;
        t1 += pm(y1, m1);

        y2--;
        int t2 = y2 * 365 + (y2 / 400) - (y2 / 100) + (y2 / 4);
        y2++;
        t2 += d2;
        t2 += pm(y2, m2);

        cout << t2 - t1 << endl;
    }

    return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;

int main(){
int sc[14]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int yd=365;
int y1,y2,m1,m2,d1,d2;
bool f=false;
while(1){
	bool FB=false;
cin>>y1>>m1>>d1>>y2>>m2>>d2;
if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0)break;
int by=y1;
int ay=y2;
int dc=0;
if((by%4==0&&by%100!=0)||by%400==0){f=true;sc[2]=29;}

if(by!=ay){
for(int i=m1;i<=12;i++)
dc+=sc[i];
dc-=d1;FB=true;
by++;

for(int i=by;i<ay;i++){
if((i%4==0&&i%100!=0)||by%400==0)dc+=366;
else {dc+=365;}
}
by=ay;
m1=1;d1=1;
}
if((by%4==0&&by%100!=0)||by%400==0){f=true;sc[2]=29;}
else sc[2]=28;
for(int i=m1;i<m2;i++)
dc+=sc[i];

dc+=d2;
if(FB==false)dc-=d1;
cout<<dc<<endl;
}
return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007


bool is_Leap(int n){
	if(n%400==0)return true;
	if(n%100==0)return false;
	if(n%4==0)return true;
	return false;
}


int main(){
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int b[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int y1,y2,m1,m2,d1,d2;
	ll ans=0;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
		ans=0;
		if(d1==-1&&d2==-1)break;
		if(y1<y2){
			if(is_Leap(y1)){
				ans+=b[m1-1]-d1+1;
				for(int i=m1; i<12; i++){
					ans+=b[i];
				}
			}
			else{
				ans+=a[m1-1]-d1+1;
				for(int i=m1; i<12; i++){
					ans+=a[i];
				}
			}
			m1=1;
			d1=1;
		}
		y1++;
		while(y1<y2){
			if(is_Leap(y1))ans+=366;
			else ans+=365;
			y1++;
		}
		for(int i=m1-1; i<m2-1; i++){
			if(is_Leap(y1))ans+=b[i];
			else ans+=a[i];
			//d1=1;
		}
		ans+=d2-d1;
		cout<<ans<<endl;
	}
}

C++: #include <iostream>

#define month(m, a) \
		for(int i = 1; i <= m; i++)\
		if(i == 2){\
			a += 28;\
		} else if(i == 4 || i == 6 || i == 9 || i == 11){\
			a += 30;\
		} else {\
			a += 31;\
		}\

using namespace std;

int main(int argc, char **argv)
{
	int y1, m1, d1, y2, m2, d2, a1, a2, a3, a4;
	
	while(1){
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if(y1 < 0 || m1 < 0 || d1 < 0 || y1 < 0 || m2 < 0 || d2 < 0){
			break;
		}
		
		a2 = y2 - y1;
		for(a1 = 0; y1 <= y2; y1++){
			if(y1%400 == 0 || (y1%4 == 0 && y1%100 != 0)){
				a1 += 1;
				y1 += 4;
				break;
			}
		}
		for(; y1 <= y2; y1 += 4){
			if(y1%400 == 0 || y1 % 100 != 0){
				a1 += 1;
			}
		}
		a2 -= a1;
		a4 = a3 = 0;
		month(m1, a3);
		month(m2, a4);

		cout << (a2*365 + a1*366 + a4 - a3 + d2 - d1) << endl;
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;

bool isleap(int y) {
    if(y%4 != 0) return false;
    if(y%400 == 0) return true;
    return y%100 != 0;
}

int dc(int y,int m,int d) {
    int res = 0;
    for(int i=1; i<y; ++i) res += 365 + isleap(i);
    for(int i=1; i<m; ++i) {
        res += 31;
        if(i == 4 || i == 6 || i == 9 || i == 11) res--;
        if(i == 2) res -= 3 + isleap(y);
    }
    res += d;
    return res;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while(cin>>y1>>m1>>d1>>y2>>m2>>d2) {
        if(y1 == -1 && y2 == -1) break;

        cout<<dc(y2,m2,d2)-dc(y1,m1,d1)<<endl;
    }
}