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 <sstream>


using namespace std;
/*
 入力1までの日数　−　入力2までの日数
*/

int day_per_month[13] ={0,31, 28, 31, 30, 31, 30 ,31, 31, 30, 31, 30, 31};
int day_per_month_leap_year[13] ={0,31, 29, 31, 30, 31, 30 ,31, 31, 30, 31, 30, 31};

int 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;
        }
        
        long long int ans1=0, ans2=0;
        
        /*--------------------------*/
        for(int i=1; i<y1; i++){
            bool flag=false;
            if(i%4==0){
                flag = true;
                if(i%100==0){
                    flag = false;
                    if(i%400==0){
                        flag = true;
                    }
                }
            }
            
            if(flag){
                ans1+=366;
            }else{
                ans1+=365;
            }
        }
        
        bool flag=false;
        if(y1%4==0){
            flag = true;
            if(y1%100==0){
                flag = false;
                if(y1%400==0){
                    flag = true;
                }
            }
        }
        
        for(int i=1; i<m1; i++){
            if(flag){
                ans1+=day_per_month_leap_year[i];
            }else{
                ans1+=day_per_month[i];
            }
        }
        
        ans1+=d1;
        
        /*--------------------------------*/
        for(int i=1; i<y2; i++){
            bool flag=false;
            if(i%4==0){
                flag = true;
                if(i%100==0){
                    flag = false;
                    if(i%400==0){
                        flag = true;
                    }
                }
            }
            
            if(flag){
                ans2+=366;
            }else{
                ans2+=365;
            }
        }
        
        flag= false;
        if(y2%4==0){
            flag = true;
            if(y2%100==0){
                flag = false;
                if(y2%400==0){
                    flag = true;
                }
            }
        }
        
        for(int i=1; i<m2; i++){
            if(flag){
                ans2+=day_per_month_leap_year[i];
            }else{
                ans2+=day_per_month[i];
            }
        }
        
        ans2+=d2;
        
        /*--------------------------*/
        
        cout<<ans2-ans1<<endl;
        
    }
}

C++: /*****include*****/
#include <iostream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
/*****変数置き場*****/
	int month_table[] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int mnt_leap_table[] = {31,29,31,30,31,30,31,31,30,31,30,31};
	int numdate1 = 0;
	int numdate2 = 0;
	int sum_date = 0;
	int year1,month1,day1,year2,month2,day2;
	/*****処理部*****/
	while(1){
		cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2;
		if(year1<0 || month1<0 || day1<0 || year2<0 || month2<0 || day2<0)	break;
		numdate1 = 0;
		numdate2 = 0;
		sum_date = 0;
		
		if((year1%4 == 0 && year1%100!=0) || year1%400==0)
			for(int i=1;i<month1;i++)
				numdate1 += mnt_leap_table[i-1];
		else
			for(int i=1;i<month1;i++)
				numdate1 += month_table[i-1];
		numdate1 += day1;
		if((year2%4 == 0 && year2%100!=0) || year2%400==0)	
		for(int i=1;i<month2;i++)
			numdate2 += mnt_leap_table[i-1];
		else
			for(int i=1;i<month2;i++)
				numdate2 += month_table[i-1];
		numdate2 += day2;
		for(int i=year1;i<year2;i++){
			if((i%4==0 && i%100!=0) || i%400==0)	
				sum_date += 366;
			else
				sum_date += 365;
		}
		sum_date += numdate2 - numdate1;
		cout << sum_date << endl;
	}
	/*****処理終了後*****/
	return 0;
}

C++: #include <cstdio>
#include <cctype>
#include <utility>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
_T _DEF(T,in,int c){T n=0;int m=1;while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_T _SCAN(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_DEF(bool, scan, int &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);} _OUT(const char *s){while(*s)pcu(*s++);} _OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_OUT(string s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{
	int e,b=0,s=1; range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
	struct it { int v, s; it (int _v, int _s) : v(_v), s(_s) {} operator int()const{return v;} operator int&(){return v;} int operator*()const{return v;}
		it& operator++(){v+=s;return *this;} }; it begin() {return {b, s};} it end() {return {e, s};}};

int read () {
	int y {in()},yy {y - 1}, m{in() - 1}, mm {}, d{in()};
	for (int i = 1; i <= m; i++) {
		if (i == 2)
			mm += 28 + (y % 4 ? 0 : y % 400 ? !!(y % 100) : 1);
		else if (i == 4 || i == 6 || i == 9 || i == 11)
			mm += 30;
		else
			mm += 31;
	}
	return yy * 365 + yy / 4 - yy / 100 + yy / 400 + mm + d;
}

int main() {
	for (;;) {
		int a {read()}, b {read()};
		if (a < 0)
			return 0;
		outl(b - a);
	}
}

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){
			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;
}