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<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

int daycnt(int y, int m, int d){
  ll res = 0; //1y1m1d
  if(m == 2)res += 31;
  else if(m == 3)res += 59;
  else if(m == 4)res += 90;
  else if(m == 5)res += 120;
  else if(m == 6)res += 151;
  else if(m == 7)res += 181;
  else if(m == 8)res += 212;
  else if(m == 9)res += 243;
  else if(m == 10)res += 273;
  else if(m == 11)res += 304;
  else if(m == 12)res += 334;
  if(m > 2 && y % 400 == 0)++res;
  else if(y % 100 != 0 && y % 4 == 0)++res;
  --y; res += y * 365 + y / 4 - y / 100 + y / 400;
  --d; res += d;
  return res;
}

signed main(void){
  int i, j;
  //pri(daycnt(1, 1, 1));
  for(int testcase = 0;testcase >= 0;testcase++){
    int y, m, d, x, l, c;
    scanf("%d%d%d%d%d%d", &y, &m, &d, &x, &l, &c);
    if(y < 0 || m < 0 || d < 0 || x < 0 || l < 0 || c < 0)break;

    pri(daycnt(x, l, c) - daycnt(y, m, d));

//*/

//*/ break;
  }
  return 0;
}

C++: #include<iostream>
#include<list>
#include<string>
#include<map>
#include<vector>
using namespace std;
bool step(int y2) {
	if ((y2) % 4 == 0) {
		if ((y2) % 100 == 0) {
			if ((y2) % 400 == 0)
				return true;
			else
				return false;
		}
		else
			return true;
	}
	else
		return false;
}
int main(){
	int y1, m1, d1, y2, m2, d2;
	int m[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
	while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 && y1>=0) {
		int y3 = y2, d3 = d2;
		if (y2<y1) {
			swap(y1, y2);
			swap(m1, m2);
			swap(d1, d2);
		}
		else if (y2 == y1) {
			if (m2<m1) {
				swap(m1, m2);
				swap(d1, d2);
			}
			else if (m2 == m1) {
				if (d2<d1) {
					swap(d1, d2);
				}
			}
		}
		if (step(y1)) d2++;
		while (y2 != y1) {
			y2--;
			if (step(y2)&&y2!=y1)
				d2 += 366;
			else
				d2 += 365;	
		}
		if (step(y3) && m2 >= 2)
			d2++;
		while (m2 < m1) {
			m2++;
			if (m2 == 2 && step(y1)) 
				d2--;
			d2 -= m[m2-1];
		}
		while (m2 > m1) {
			m2--;
			if (m2 == 2 && step(y1))
				d2++;
			d2 += m[m2 - 1];
		}
		d2 -= d1;
		cout <<d2<< endl;
	}
}

C++: #include <cstdio>

bool uruu(int year);

int main(void)
{
    while (1){
        int y1, y2, m1, m2, d1, d2;
        scanf("%d %d %d %d %d %d", &y1, &m1, &d1, &y2, &m2, &d2);
        if (y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0){
            break;
        }
        
        // ツ催渉可づ可禿シツ療債つウツづェツつスツづ「ツづつつェツ暗ェツ年ツづ可スツ禿コツ姪堋つゥ
        int day1 = 0;
        for (int i = 1; i <= m1; i++){
            day1 += 31;
            if (i == 4 || i == 6 || i == 9 || i == 11){
                day1 -= 1;
            }
            if (i == 2){
                day1 -= 3;
                if (uruu(y1)){
                    day1 += 1;
                }
            }
        }
        day1 += d1;
        
        // ツ篠淞づ可禿シツ療債つウツづェツつスツづ「ツづつつェツ暗ェツ年ツづ可スツ禿コツ姪堋つゥ
        int day2 = 0;
        for (int i = 1; i <= m2; i++){
            day2 += 31;
            if (i == 4 || i == 6 || i == 9 || i == 11){
                day2 -= 1;
            }
            if (i == 2){
                day2 -= 3;
                if (uruu(y2)){
                    day2 += 1;
                }
            }
        }
        day2 += d2;
        
        // ツ年ツづ個計ツ算
        int ans = day2 - day1;
        while (y1 != y2){
            if (uruu(y1)) ans += 366;
            else ans += 365;
            y1++;
        }
        
        printf("%d\n", ans);
    }
}

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

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++: #include<stdio.h>
int main(void){
	int y1,m1,d1,y2,m2,d2;
	int i;
	int y1day,y2day;
	while(1){
		scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
		y1day=y2day=0;
		if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1  || d2==-1) break;
		y1day=y2day=0;
		for(i=1;i<y1;i++){
			y1day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y1day++;
		}
		for(i=1;i<m1;i++){
			y1day+=31;
			if(i==4 || i==6 || i==9 || i==11) y1day-=1;
			if(i==2){
				y1day-=3;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y1day++;
			}
		}
		y1day+=d1;
		for(i=1;i<y2;i++){
			y2day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y2day++;
		}
		for(i=1;i<m2;i++)	{
			y2day+=31;
			if(i==4 || i==6 || i==9 || i==11) y2day--;
			if(i==2){
				y2day-=3;
				if((y2%4==0 && y2%100!=0) || y2%400==0) y2day++;
			}
	//		printf("y2d==%d\n",y2day);
		}
		y2day+=d2;
	//	printf("%d %d\n",y1day,y2day);
		printf("%d\n",y2day-y1day);
	}
	return 0;
}