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>
using namespace std;
unsigned int x[10000000], day[13][32], day2[13][32], cnt, a, b, c, d, e, f, daya1, daya2;
int days[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int days2[13] = { 0,31,29,31,30,31,30,31,31,30,31,30,31 };
int main() {
	for (int i = 1; i < 10000000; i++) {
		if ((i % 4 == 0 && i % 100>0) || i % 400 == 0) {
			x[i] = x[i - 1] + 366;
		}
		else {
			x[i] = x[i - 1] + 365;
		}
	}
	for (int i = 1; i <= 12; i++) {
		for (int j = 1; j <= days[i]; j++) {
			day[i][j] = cnt;
			cnt++;
		}
	}
	cnt = 0;
	for (int i = 1; i <= 12; i++) {
		for (int j = 1; j <= days2[i]; j++) {
			day2[i][j] = cnt;
			cnt++;
		}
	}
	while (true) {
		cin >> a >> b >> c >> d >> e >> f;
		if (a < 0) { break; }
		if (b < 0) { break; }
		if (c < 0) { break; }
		if (d < 0) { break; }
		if (e < 0) { break; }
		if (f < 0) { break; }
		daya1 = 0; daya2 = 0;
		daya1 += x[a - 1];
		daya2 += x[d - 1];
		if (a % 4 == 0) {
			daya1 += day2[b][c];
		}
		else {
			daya1 += day[b][c];
		}
		if (d % 4 == 0) {
			daya2 += day2[e][f];
		}
		else {
			daya2 += day[e][f];
		}
		cout << daya2 - daya1 << endl;
	}
}

C++: #include <iostream>
#include <sstream>


using namespace std;


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;
        }
        int y,m;
        y=y1;
        int day = 0;

        
        while(1){
            if(y+1>y2)break;
            
            day+=365;
            if(y%4==0){
                day++;
                if(y%100==0){
                    day--;
                    if(y%400==0){
                        day++;
                    }
                }
            }
            y++;
            
        }
        
        if(m1<m2){
            m=m1;
            while(1){
                if(m+1>m2)break;
                double flag=false;
                if(y1%4==0){
                    flag=true;
                    if(y1%100==0){
                        flag=false;
                        if(y1%400==0){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    day+=day_per_month_leap_year[m];
                    m++;
                }else{
                    day+=day_per_month[m];
                    m++;
                }
            }
        }else if(m1>m2){
            m=m2;
            while(1){
                if(m-1<m1)break;
                double flag=false;
                if(y2%4==0){
                    flag=true;
                    if(y2%100==0){
                        flag=false;
                        if(y2%400==0){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    m--;
                    day-=day_per_month_leap_year[m];
                }else{
                    m--;
                    day-=day_per_month[m];
                }
            }
        }
        //cout<<day<<endl;
        
        day+=d2-d1;
        
        cout<<day<<endl;
        
        
        
    }
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int fairfield(int y,int m,int d)
{
	if(m<=2){
		y--;
		m+=12;
	}
	return 365*y+y/4-y/100+y/400+153*(m+1)/5+d-428;
}

int main()
{
	for(int y1,m1,d1,y2,m2,d2;cin>>y1>>m1>>d1>>y2>>m2>>d2,~(y1|m1|d1|y2|m2|d2);){
		cout<<fairfield(y2,m2,d2)-fairfield(y1,m1,d1)<<endl;
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

int big_small(int y1,int m1,int d1,int y2,int m2,int d2){ /*-1 hidari 1 migi 0 onazi*/
	if(y1>y2) return -1;
	else if(y1<y2) return 1;
	else if(m1>m2) return -1;
	else if(m1<m2) return 1;
	else if(d1>d2) return -1;
	else if(d1<d2) return 1;
	return 0;
}

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

int get_day(int y,int m){
	if(m==1) return 31;
	else if(m==2){
		if(uruu(y)) return 29;
		return 28;
	}
	else if(m==3) return 31;
	else if(m==4) return 30;
	else if(m==5) return 31;
	else if(m==6) return 30;
	else if(m==7) return 31;
	else if(m==8) return 31;
	else if(m==9) return 30;
	else if(m==10) return 31;
	else if(m==11) return 30;
	else if(m==12) return 31;
	return -1;
}

int main(){

	int y1,m1,d1,y2,m2,d2;
	int c;

	while(1){

		cin>>y1>>m1>>d1>>y2>>m2>>d2;

		if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0) break;

		c=0;

		while(1){
			int tmpy=y1+1,tmpm=m1,tmpd=d1;
			if(big_small(tmpy,tmpm,tmpd,y2,m2,d2)==-1) break;
			if(m1>=3){
				if(uruu(y1+1)) c+=366;
				else c+=365;
			}
			else{
				if(uruu(y1)) c+=366;
				else c+=365;
			}
			y1=tmpy,m1=tmpm,d1=tmpd;
		}


		while(1){
			int tmpy=y1,tmpm=m1+1,tmpd=d1;
			if(tmpm==13) tmpy++,tmpm=1;
			if(big_small(tmpy,tmpm,tmpd,y2,m2,d2)==-1) break;
			c+=get_day(y1,m1);
			y1=tmpy,m1=tmpm,d1=tmpd;
		}

		while(1){
			int tmpy=y1,tmpm=m1,tmpd=d1+1;
			if(tmpd>get_day(y1,m1)) tmpm++,tmpd=1;
			if(tmpm==13) tmpy++,tmpm=1;
			if(big_small(tmpy,tmpm,tmpd,y2,m2,d2)==-1) break;
			c++;
			y1=tmpy,m1=tmpm,d1=tmpd;
		}

		cout<<c<<endl;
	}
}