Go: package main

import (
	"bufio"
		"os"
	"strings"
	"strconv"
	"time"
	"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)))
	}
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

bool isLeap(int i){
	return i % 400 == 0 
			? true : i % 100 == 0
			? false : i % 4 == 0
			? true : false;
}

int getSum(int y,int m,int d,const int* month){
	int sum=0;
	for(int i=0;i<y;i++){
		sum += isLeap(i) ? 366 : 365;
	}

	for(int i=1;i<m;i++){
		sum += i != 2 ? month[i] : month[i] + 1;
	}

	sum += d;

	return sum;
}

int main(){
	const int month[] = {-1,31,28,31,30,31,30,31,31,30,31,30,31};
	char buf[64];
	int win,lose,draw;	
	int n;
	bool isnl = false;
	int y1, m1, d1, y2, m2, d2;
	while(~scanf("%d %d %d %d %d %d",&y1, &m1, &d1, &y2, &m2, &d2)){
		if(y1 == -1 || m1 == -1 || d1 == -1
			|| y2 == -1 || m2 == -1 || d2 == -1) break;

		cout << abs(getSum(y1,m1,d1,month) - getSum(y2,m2,d2,month)) << endl;
	}
}

C++: #include <cstdio>

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

int day[2][12]={

{31,28,31,30,31,30,31,31,30,31,30,31},

{31,29,31,30,31,30,31,31,30,31,30,31}

};

bool uruu(int year) {

    if (year%400==0) return true;

    else if (year%100==0) return false;

    else if (year%4==0) return true;

    else return false;

}

int main() {

    while (scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)) {

        if (y1==-1&&m1==-1&&d1==-1&&y2==-1&&m2==-1&&d2==-1) break;

        long long res = 0, flag;

        if (y1==y2) {

            if (uruu(y1)) flag = 1;

            else flag = 0;

            if (m1==m2) res = d2-d1;

            else {

                for (int i=m1; i<m2-1; i++) res += day[flag][i];

                res += day[flag][m1-1] - d1;

                res += d2;

            }

        } else {

            if (uruu(y1)) flag = 1;

            else flag = 0;

            for (int i=m1; i<12; i++) res += day[flag][i];

            res += day[flag][m1-1] - d1;

            if (y1+1<y2) for (int i=y1+1; i<y2; i++) {

                if (uruu(i)) res += 366;

                else res += 365;

            }

            if (uruu(y2)) flag = 1;

            else flag = 0;

            for (int i=0; i<m2-1; i++) res += day[flag][i];

            res += d2;

        }

        printf("%lld\n", res);

    }

}

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




long long ly[55];
long long ry[55];
long long lm[55];
long long rm[55];
long long ld[55];
long long rd[55];

int imos[15];
int rimos[15];
int month[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int umos[15];
int rumos[15];

int init(){
    for (int i = 1; i < 13; i++){
        imos[i] = month[i] + imos[i-1];
        umos[i] = imos[i];
        if (i >= 2) umos[i]++;
    }
    for (int i = 12; i >= 0; i--){
        rimos[i] = month[i] + rimos[i+1];
        rumos[i] = rimos[i];
        if (i <= 2) rumos[i]++;
    }
    return 0;
}


int main(void){
    int cnt = 0;
    init();
    while (1){
        long long 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;
        for (int j = ly[i]; j <= ry[i]; j++){
            ans += 365;
            if (!(j % 4) ){
                if (j % 100) ans++;
                else if(!(j % 400)) ans++;
            }
        }
        int j = ly[i];

        if (!(j % 4) && j % 100) ans -= umos[lm[i]-1];
        else if(!(j % 400)) ans -= umos[lm[i]-1];
        else ans -= imos[lm[i]-1];
        ans -= ld[i];

        j = ry[i];
        

        if (!(j % 4 ) && j % 100) ans -= rumos[rm[i]];
        else if(!(j % 400)) ans -= rumos[rm[i]];
        else ans -= rimos[rm[i]];
        ans += rd[i];        

        

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