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>
#include<vector>
#include<cmath>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

int days[2][13] = {{0,31,28,31,30,31,30,31,31,30,31,30,31},
		   {0,31,29,31,30,31,30,31,31,30,31,30,31}};//leap year
bool isLeap(int year)
{
  return ((year%4) == 0 && (year%100) != 0 || ( year % 400 ) == 0);
}

int main()
{
  while(true)
    {
      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)break;

      int dayc = 0;
      bool f = true;
      for(int y=y1;y<=y2;y++)
	{
	  for(int m=(f?m1:1);m<=12;m++)
	    {
	      for(int d=(f?d1:1);d<=days[isLeap(y)][m];d++)
		{
		  f = false;
		  dayc++;
		  if(y == y2 && m == m2 && d == d2)goto Fin;
		}
	    }
	}
    Fin:;
      cout << dayc-1 << endl;
    }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
vector<int>year(1, 0), month{ 0,0,31,28,31,30,31,30,31,31,30,31,30,31 }, day;
int YEAR(int n) {
	if (n < year.size())return year[n];

	int x = year.size() - 1;
	while (year.size() <= n) {
		if (x % 4 == 0 && (x % 100 != 0 || x % 400 == 0))year.push_back(year[x] + 366);
		else year.push_back(year[x] + 365);
		x++;
	}

	return year[n];
}
int Month(int y, int m) {
	int res = month[m];
	if (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) {
		if(m>=3)res++;
	}
	return res;
}
signed main() {
	rep(i, 1, month.size())month[i] += month[i - 1];
	while (1) {
		int y1, y2, m1, m2, d1, d2;
		if (y1 < 0 || y2 < 0 || m1 < 0 || m2 < 0 || d1 < 0 || d2 < 0)break;
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;

		cout << YEAR(y2) - YEAR(y1) + Month(y2, m2) - Month(y1, m1) + d2 - d1 << endl;;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<boost/date_time/gregorian/gregorian.hpp>

using namespace std;

int main(){
  int y1, m1, d1, y2, m2, d2;
  while(scanf("%d%d%d%d%d%d",
              &y1, &m1, &d1,
              &y2, &m2, &d2), y1 != -1){
    boost::gregorian::date day1(y1, m1, d1);
    boost::gregorian::date day2(y2, m2, d2);
    printf("%d\n", (int)abs((day1 - day2).days()));
  }
  return 0;
}

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

int main()
{
	while (1)
	{
		int L, R; L = R = 0;
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if (a<0 || b<0 || c<0||d<0||e<0||f<0)break;
		for (int g = 1; g < a; g++)
		{
			if (g % 400 == 0) L += 366;
			else if (g % 100 == 0) L += 365;
			else if (g % 4 == 0)L += 366;
			else L += 365;
		}
		
		for (int g = 1; g < d; g++)
		{
			if (g % 400 == 0) R += 366;
			else if (g % 100 == 0) R += 365;
			else if (g % 4 == 0)R += 366;
			else R += 365;
		}
		
		for (int h = 1; h < b; h++) {
			switch (h) {
			case 1:case 3:case 5:case 7:case 8:case 10:case 12:L += 31; break;
			case 4:case 6:case 9:case 11:L += 30; break;
			case 2:if (a % 400 == 0) L += 29;
				   else if (a % 100 == 0) L += 28;
				   else if (a % 4 == 0)L += 29;
				   else L += 28;
			}
			}
			
			for (int h = 1; h < e; h++) {
				switch (h) {
				case 1:case 3:case 5:case 7:case 8:case 10:case 12:R += 31; break;
				case 4:case 6:case 9:case 11:R += 30; break;
				case 2:if (a % 400 == 0)R += 29;
					   else if (a % 100 == 0) R += 28;
					   else if (a % 4 == 0)R += 29;
					   else R += 28;
				}
			}
			
		cout << (R + f) - (L + c) << endl;
	}
}

C++: #include <iostream>
using namespace std;
int y[2],m[2],d[2];
int d31[7] = {1,3,5,7,8,10,12};
int d30[4] = {4,6,9,11};
bool flg,uru,eq;


void check() {
  uru = 0;
  if(y[0] % 4 == 0)
    if(y[0]%100 !=0) uru = 1;
  
  if(y[0]%400 == 0) uru = 1;
}


int main() {


  while(1) {
    
    for(int i=0;i<2;i++) cin >> y[i] >> m[i] >> d[i];
    if(y[0] == -1 && d[0] == -1) break;
    check();
    int count = 0;
    while(1) {
      //      cout << y[0] <<" " <<  m[0] <<" " << d[0] << endl; 
      if(y[0] == y[1] && m[0] == m[1] && d[0] == d[1]) break;
    
      flg = 0;
      for(int i=0;i<4;i++)
	if(d30[i] == m[0])flg = 1;
      
      if(m[0] == 2 && d[0] == 28 && uru == 0) {
	m[0]++;
	d[0] = 0;
      } else if(m[0] == 2 && d[0] == 29){
	m[0]++;
	d[0] = 0;
      } else if(d[0] == 30 && flg == 1) {
	m[0]++;
	d[0]=0;
      } else if(d[0] == 31) {
	m[0]++;
	d[0]=0;
      
	if(m[0] == 13) {
	  m[0] = 1;
	  y[0]++;
	  check();
	}
      }
      count++;
      d[0]++;
    }
     
    cout << count << endl;
    
  }
  
  
}