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++: #include<iostream>

bool isleap( int y )
{
	return ( y % 4 == 0 && y % 100 != 0 ) || y % 400 == 0;
}

int calc( int y, int m, int d )
{
	int ret = 0;

	for( int i = 0; i <= y; ++i )
	{
		for( int j = 1; j <= ( i == y ? m : 12 ); ++j )
		{
			if( i == y && j == m )
				ret += d;
			else if( j == 2 )
				ret += 28 + isleap( i );
			else if( j == 4 || j == 6 || j == 9 || j == 11 )
				ret += 30;
			else
				ret += 31;
		}
	}

	return ret;
}

int main()
{
	int y[2], m[2], d[2];
	while( true )
	{
		for( int i = 0; i != 2; ++i )
			if( !( std::cin >> y[i] >> m[i] >> d[i] ) || y[i] < 0 || m[i] < 0 || d[i] < 0 )
				return 0;

		std::cout << calc( y[1], m[1], d[1] ) - calc( y[0], m[0], d[0] ) << std::endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  int y1,m1,d1,y2,m2,d2;
  int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
  for(int i=0;i<12;i++)
    month[i+1] += month[i];

  while(true){
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if (y1==-1)
      break;
    int day=0;
    day += d2-d1+month[m2-1]-month[m1-1]+(y2-y1)*365;
    if(m2<3)
      y2--;
    if(m1>2)
      y1++;
    day += y2/4-(y1-1)/4-y2/100+(y1-1)/100+y2/400-(y1-1)/400;
    cout << day << endl;
  }
  return 0;
}

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

struct date {
    int y, m, d;
};

int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool isUru(int n) {
    return (n % 4 == 0 && (n % 100 || n % 400 == 0));
}

int main() {
    date d, e;
    while (true) {
        cin >> d.y >> d.m >> d.d >> e.y >> e.m >> e.d;
        if (d.y < 0 || d.m < 0 || d.d < 0 || e.y < 0 || e.m < 0 || e.d < 0) return 0; 
        int count = 0;
        if (e.y - d.y > 1) {
            count += (e.y - d.y - 1) * 365;
        }
        if (d.y == e.y) {
            for (int i = d.m + 1; i < e.m; i++) {
                count += month[i];
            }
        } else {
            for (int i = d.m + 1; i < 13; i++) {
                count += month[i];
            }
            for (int i = 1; i < e.m; i++) {
                count += month[i];
            }
        }
        if (d.y < e.y || d.m < e.m) {
            count += month[d.m] - d.d + 1;
            count += e.d - 1;
        } else {
            count += e.d - d.d;
        }

        if (d.m < 2 && isUru(d.y)) {
            count++;
        }
        if (e.m >= 2 && isUru(e.y)) {
            count++;
        }
        for (int i = d.y + 1; i < e.y; i++) {
            if (isUru(i)) count++;
        }
        cout << count << endl;
    }
}

C++: #include <iostream>

using namespace std;

class Data{
	public:
	int y;
	int m;
	int d;
};

int getday(int y, int m, int d){
	int ret=0;
	
	for(int i=0;i<y;i++){
		if((i%4==0 && i%100 != 0) || i%400 == 0){
			ret += 366;
		}else{
			ret += 365;
		}
	}
	
	for(int i=1;i<m;i++){
		if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){
			ret += 31;
		}else if(i==2){
			if((y%4==0 && y%100 != 0) || y%400 == 0){
				ret += 29;
			}else{
				ret += 28;
			}
		}else{
			ret += 30;
		}
	}
	ret += d;
	return ret;
}

int main(void){
	Data d1, d2;
	
	while(cin >> d1.y >> d1.m >> d1.d >> d2.y >> d2.m >> d2.d){
		if((d1.y|d1.m|d1.d|d2.y|d2.m|d2.d) & 1 << 31) break;
		
		cout << getday(d2.y,d2.m,d2.d) - getday(d1.y,d1.m,d1.d) << endl;;
	}
}

C++: #include<cstdio>
#include<iostream>
#include<map>
using namespace std;
inline bool check(int year) {
	return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
}
int cnt(int year) {
	int ans = 0;
	for(int i = 1; i <= year; i++) {
		if(check(i)) ans++;
	}
	return ans;
}
int main() {
	int d[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	for(int i = 2; i <= 12; i++) {
		d[i] += d[i-1];
	}
	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;
		int a1 = 365 * (y1 - 1) + cnt(m1 > 2 ? y1 : y1 - 1) + d[m1-1] + d1;
		int a2 = 365 * (y2 - 1) + cnt(m2 > 2 ? y2 : y2 - 1) + d[m2-1] + d2;
		printf("%d\n",a2 - a1);
	}
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int a, b, c, d, e, f;
    auto get = [&](int y, int m, int d){
        if(m <= 2) y--, m += 12;
        return 365*y+y/4-y/100+y/400+306*(m+1)/10+d-428;
    };
    while(cin >> a >> b >> c >> d >> e >> f, ~a){
        cout << get(d, e, f) - get(a, b, c) << "\n";
    }
    return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

/*--- year??´month???day??\????????\????±??????? ---*/
tm dayofweek(int year, int month, int day)
{
	struct tm  t;

	t.tm_year = year - 1900;    /* ??´????????´ */
	t.tm_mon = month - 1;        /* ???????????´ */
	t.tm_mday = day;            /* ??\ */
	t.tm_hour = 0;                /* ??? */
	t.tm_min = 0;                /* ??? */
	t.tm_sec = 0;                /* ?§? */
	t.tm_isdst = -1;            /* ????????? */

	return t;
}
int main() {
	while (1) {
		int y1, m1, d1, y2, m2, d2; cin >> y1 >> m1 >> d1 >> y2 >>m2>> d2;
		if (y1 == -1)break;
		tm a = dayofweek(y1, m1, d1);
		tm b = dayofweek(y2, m2, d2);
		double diff = difftime(mktime(&b),mktime(&a));
		cout << int(diff / 60 / 60 / 24 + 0.5) << endl;
	}
	return 0;
}