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;
int getday(int, int, int);

int main(void)
{
  int y1, m1, d1, y2, m2, d2;
  int day1, day2;
  int year;
  
  while(1) {
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;
    day1 = getday(y1, m1, d1);
    day2 = getday(y2, m2, d2);
    
    cout << day2 - day1 << endl;
  }
  return 0;
}

int getday(int y, int m, int d)
{
  int day = 0,u;

  u = (y % 4 == 0 && y % 100 != 0 || y % 400 == 0);

  for(int i = 1 ; i < y ; i++) {
    day += 365;
    if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0) day += 1;
      }

  for(int i = 1 ; i < m ; i++) {
    day += 30;
    if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) day++;
    if(i == 2) { day -= 2; if(u) day++; }
  }
  for(int i = 0 ; i < d ; i++) {
    day++;
  }
  return day;
}

C++: #include<iostream>
#include<cstring>
#include<ctime>
using namespace std;
class Date{
	int y, m ,d;
public:
	bool GetDate(){
		cin >> y >> m >> d;
		if( y < 0 || m < 0 || d < 0 ) return false;
		else return true;
	}
	static bool isLeap(int y){
		return ( y % 4 == 0 && ( y % 100 != 0 || y % 400 == 0 ) );
	}
	unsigned int days() const {
		unsigned int ret = 0;
		const int md[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(int ty = 0; ty < y; ++ty){
			ret += isLeap( ty ) ? 366 : 365;
		}
		for(int tm = 1; tm < m; ++tm){
			ret += md[tm];
		}
		ret += d;
		return ret;
	}
	unsigned int operator-(const Date &t) const {
		return this->days() - t.days();
	}
};
int main(void){
	while( true ){
		Date date1, date2;
		if( !date1.GetDate() || !date2.GetDate() )
			break;
		
		cout << date2 - date1 << '\n';
	}
	return 0;
}

C++: #include <iostream>

#include <vector>

#include <algorithm>

#include <sstream>

#include <string>

#include <cmath>

#include <list>

#include <set>
using namespace std;

int in() {int x; cin >> x; return x;}

template <typename T> class SegTree

{

public:

	int n;

	T T_max;

	vector<T> dat;

	SegTree(int n_, T t_max)

	{

		int n = 1;

		T_max = t_max;

		while (n < n_)n *= 2;

		for (int i = 0; i < 2 * n - 1; i++)dat.push_back(t_max);

	}

	void update(int k, T a)

	{

		k += n - 1;

		dat[k] = a;

		while (k > 0)

		{

			k = (k - 1) / 2;

			dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);

		}

	}



	//[a,b)

	T query(int a, int b)

	{

		return _query(a, b, 0, 0, n);

	}



private:

	T _query(int a, int b, int k, int l, int r)

	{

		if (r <= a || b <= l)return T_max;

		if (a <= l && r <= b)return dat[k];

		else

		{

			T vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);

			T vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);

			return min(vr, vl);

		}

	}

};

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

int main()
{
	int dat[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int y, m, d, Y, M, D;
	while (cin >> y >> m >> d >> Y >> M >> D && y != -1)
	{
		int ans = 0;
		ans -= d - 1; d = 1;
		for (; m >= 1; m--)
		{
			ans -= dat[m];
			if (uruu(y) && m == 2)
			{
				ans -= 1;
			}
		}

		ans += D - 1; D = 1;
		for (; M >= 1; M--)
		{
			ans += dat[M];
			if (uruu(Y) && M == 2)
			{
				ans += 1;
			}
		}
		for (; y < Y; y++)
		{
			ans += 365;
			if (uruu(y))
			{
				ans += 1;
			}
		}

		cout << ans << endl;
	}
}

C++: #include<iostream>
using namespace std;
int x[1000000], 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 < 1000000; 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++: //Name: Day Count
//Level: 2
//Category: 日付
//Note: 

/**
 * 1年1月0日からの経過日数を求める関数を作ればよい。
 *
 * オーダーは O(1)。
 */
#include <iostream>

using namespace std;

int calc(int y, int m, int d) {
    static const int DAYS[13] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int ans = 0;
    ans += (y-1) * 365 + (y-1)/4 - (y-1)/100 + (y-1)/400;
    for(int i = 1; i < m; ++i) ans += DAYS[i];
    if(m > 2 && (y%4 == 0 && (y%100 != 0 || y%400 == 0))) ++ans;
    ans += d;
    return ans;
}

bool solve(bool first) {
    int y1, m1, d1, y2, m2, d2;
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) return false;
    cout << calc(y2, m2, d2) - calc(y1, m1, d1) << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.setf(ios::fixed);
    cout.precision(10);

    bool first = true;
    while(solve(first)) first = false;
    return 0;
}

C++: #include <iostream>

using namespace std;
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31,30, 31};

void solve()
{
	int y[2], m[2], d[2];
	while(cin >> y[0] >> m[0] >> d[0] >> y[1] >> m[1] >> d[1])
	{
		if(y[0] < 0 || m[0] < 0 || d[0] < 0 || y[1] < 0 || m[1] < 0 || d[1] < 0)
		{
			break;
		}
		int count[2] = {0, 0};
		for(int a = 0; a < 2; ++a)
		{
			for(int i = 0; i < y[a]; ++i)
			{
				if(i % 400 == 0 || (i % 100 != 0 && i % 4 == 0))
				{
					count[a]++;
				}
			}
		}
		for(int i = 0; i < 2; ++i)
		{
			y[i]--;
			m[i]--;
			d[i]--;
		}
		
		int day[2] = {0, 0};
		for(int a = 0; a < 2; ++a)
		{
			day[a] = y[a] * 365 + count[a] + d[a];
			for(int i = 0; i < m[a]; ++i)
			{
				day[a] += month[i];
			}
		}
		cout << day[1] - day[0] << endl;
	}
}

int main()
{
	solve();
	return(0);
}