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 <fstream>
#include <string> 
#include <cstring>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
//#include <boost/multiprecision/cpp_int.hpp>

#define BIT(a) (1 << (a))
#define EPS (1e-10)

using namespace std;
//using namespace boost::multiprecision;

const long long MOD = 1000000007;
const int COUNTER_CLOCKWISE = 1;
const int CLOCKWISE = -1;
const int ONLINE_BACK = 2;
const int ONLINE_FRONT = -2;
const int ON_SEGMENT = 0;

class Point{
    public:
    double x, y;

    Point(double x = 0, double y = 0): x(x), y(y) {}
    
    Point operator+(Point p){return Point(x + p.x, y + p.y);}
    Point operator-(Point p){return Point(x - p.x, y - p.y);}
    Point operator*(double a){return Point(a * x, a * y);}
    Point operator/(double a){return Point(x / a, y / a);}

    bool operator < (const Point &p) const {
        return y != p.y ? y < p.y : x < p.x;
    }

    double norm(){return x * x + y * y;}
};
typedef Point Vector;
typedef vector<Vector> Polygon;

double cross(Vector a, Vector b){
    return a.x*b.y - a.y*b.x;
}

double dot(Vector a, Vector b){
    return a.x * b.x + a.y * b.y;
}

int ccw(Point p0, Point p1, Point p2){
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    if (cross(a, b) > EPS)return COUNTER_CLOCKWISE;
    if (cross(a, b) > -EPS)return CLOCKWISE;
    if (dot(a, b) < -EPS)return ONLINE_BACK;
    if (a.norm() < b.norm())return ONLINE_FRONT;

    return ON_SEGMENT;
}

Polygon andrewScan(Polygon s){
    Polygon u, l;
    if (s.size() < 3) return s;
    sort(s.begin(), s.end());
    u.push_back(s[0]);
    u.push_back(s[1]);
    l.push_back(s[s.size()-1]);
    l.push_back(s[s.size()-2]);
    
    for (size_t i = 2; i < s.size(); i++){
        for (size_t n = u.size(); n >= 2 && ccw(u[n-2], u[n-1], s[i]) == COUNTER_CLOCKWISE; n--){
            u.pop_back();
        }
        u.push_back(s[i]);
    }

    for (int i = (int)s.size() - 3; i >= 0; i--){
        for (size_t n = l.size(); n >= 2 && ccw(l[n-2], l[n-1], s[i]) == COUNTER_CLOCKWISE; n--){
            l.pop_back();
        }
        l.push_back(s[i]);
    }

    reverse(l.begin(), l.end());
    for (size_t i = u.size() - 2; i >= 1; i--) l.push_back(u[i]);

    return l;
}

long long mod_pow(long long x, long long n){
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}


int ly[51];
int ry[51];
int lm[51];
int rm[51];
int ld[51];
int rd[51];

int mimos[13];

void init(){
    int month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for (int i = 1; i < 13; i++){
        mimos[i] = month[i] + mimos[i-1];
    }
    return;
}


int main(void){
    int cnt = 0;
    init();
    while (1){
        int tmp[6];
        int flag = 0;
        for (int i = 0; i < 6; i++){
            cin >> tmp[i];
            if (tmp[i] == -1) flag = 1;
        }
        if (flag) break;
        ly[cnt] = tmp[0];
        lm[cnt] = tmp[1];
        ld[cnt] = tmp[2];
        ry[cnt] = tmp[3];
        rm[cnt] = tmp[4];
        rd[cnt] = tmp[5];
        cnt++;
    }

    for (int i = 0; i < cnt; i++){
        long long ans = 0;
        ans += (ry[i] - ly[i])*365;
        ans += (mimos[rm[i]] - mimos[lm[i]] - ld[i] + rd[i]);
        if (!ly[i] % 4){
            if (lm[i] > 4 ){
                ans++;
                if (!ly[i] % 100){
                    ans--;
                    if (!ly[i] % 400){
                        ans++;
                    }
                }
            }
        }
        
        for (int j = ly[i]; j < ry[i]; j++){
            if (j % 4 == 0){
                ans += ((ry[i] - j - 1) / 4) + 1;
                break;
            }
        }

        for (int j = ly[i]; j < ry[i]; j++){
            if (j % 100 == 0){
                ans -= (((ry[i] - 1 - j) / 100) + 1);
                break;
            }
        }

        for (int j = ly[i]; j < ry[i]; j++){
            if (j % 400 == 0){
                ans += (((ry[i] - 1 - j) / 400) + 1);
                break;
            }
        }

        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


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

int main(){

	const int md[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

	int y1,m1,d1,y2,m2,d2;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2&&(y1>=0&&m1>=0&&d1>=0&&y2>=0&&m2>=0&&d2>=0)){
		int sum=0;
		if(y1!=y2){
			for(int y = y1+1; y < y2; y++){
				if(checkUru(y)){
					sum+=366;
				}
				else
					sum+=365;
			}
			// y1ツづ2ツづ可づつつ「ツづ計ツ算
			if(checkUru(y1)){
				sum+=(md[m1]-d1);
				if(m1==2)
					sum++;
				for(int m=m1+1; m<=12; m++){
					if(m==2)
						sum++;
					sum+=md[m];
				}
			}
			else{
				sum+=(md[m1]-d1);
				for(int m=m1+1; m<=12; m++){
					sum+=md[m];
				}
			}
			
			if(checkUru(y2)){
				sum+=(d1);

				for(int m=1; m<m2; m++){
					if(m==2)
						sum++;
					sum+=md[m];
				}
			}
			else{
				sum+=(d1);
				for(int m=1; m<m2; m++){
					sum+=md[m];
				}
			}
		}
		else{
			if(m1!=m2){
				for(int m=m1+1; m < m2; m++){
					if(checkUru(y1)&&m==2){
						sum+=29;
					}
					else
						sum+=md[m];
				}
				// m1ツづ2ツづ可づつつ「ツづ計ツ算
				if(checkUru(y1)&&m1==2){
					sum+=(md[m1]-d1)+1;
				}
				else
					sum+=(md[m1]-d1);
				// m2
				if(checkUru(y1)&&m2==2){
					sum+=d2+1;
				}
				else
					sum+=d2;

				//				sum+=d2;
			}
			else{
				sum+=d2-d1;
			}
		}
		cout<<sum<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

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

// 1??´1???1??\???????????\??°
long long int day_sum(int y, int m, int d){
	long long int ans;
	ans = 0;
	
	y--;
	
	if(y == 0){
		ans++;
	}
	
	ans += y * 365;
	ans += (y / 4 - y / 100 + y / 400);
	
	for(int i = 0; i < m - 1; i++){
		ans += days[i];
	}
	ans += d - 1;
	if(((y % 4 == 0) * 2 - 1) * ((y % 100 == 0) * 2 - 1) * ((y % 400 == 0) * 2 - 1) > 0){
		if(m >= 3){
			ans++;
		}
	}
	return ans;
}

int main(){
	
	int y1, m1, d1, y2, m2, d2;
	while(true){
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0){
			break;
		}
		printf("%lld\n", day_sum(y2, m2, d2) - day_sum(y1, m1, d1));
	}
	
	return 0;
}