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 main(){
    long long days1,days2;
    int y1,m1,d1,y2,m2,d2;
    while(1){
        days1 = 0;
        days2 = 0;
        cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
        if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;
        for(int i=1;i<y1;i++){
            if((i%4 == 0 && i%100 != 0) || i%400 == 0) days1 += 366;
            else days1 += 365;
        }
        for(int i=1;i<y2;i++){
            if((i%4 == 0 && i%100 != 0) || i%400 == 0) days2 += 366;
            else days2 += 365;
        }
        for(int i=1;i<m1;i++){
            switch(i){
                case 4:
                case 6:
                case 9:
                case 11:
                    days1 += 30;
                    break;
                case 2:
                    if((i%4 == 0 && i%100 != 0) || i%400 == 0) days1 += 29;
                    else days1 += 28;
                    break;
                default:
                    days1 += 31;
                    break;
            }
        }
        for(int i=1;i<m2;i++){
            switch(i){
                case 4:
                case 6:
                case 9:
                case 11:
                    days2 += 30;
                    break;
                case 2:
                    if((i%4 == 0 && i%100 != 0) || i%400 == 0) days2 += 29;
                    else days2 += 28;
                    break;
                default:
                    days2 += 31;
                    break;
            }
        }
        days1 += d1;
        days2 += d2;
        cout << days2 - days1 << endl;
    }
}

C++: #include <iostream>

using namespace std;

int main() {
    int day[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 } };
    int y1, m1, d1, y2, m2, d2;
    while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
        if (y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) {
            break;
        }
        int ans = 0;
        for (int i = y1, j = m1, k = d1; i <= y2; i++) {
            for (; j <= 12; j++) {
                for (; k <= day[(i % 4 == 0 && i % 100 != 0) || i % 400 == 0][j]; k++) {
                    if (i == y2 && j == m2 && k == d2) {
                        goto Fin;
                    }
                    ans++;
                }
                k = 1;
            }
            j = 1;
        }
    Fin:;
        cout << ans << endl;
    }
    return 0;
}

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

int y[2],m[2],d[2];

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

int calc(int y,int m,int d){
  int cnt=(y-1)/4-(y-1)/100+(y-1)/400;
  int res = y*365;
  res=res+cnt+1-365;


  if(y%4==0&&(y%100!=0||y%400==0))t[2]++;
  int cnt2=0;
  for(int i=1;i<=m;i++){
    for(int j=1;j<=(i==m?d-1:t[i]);j++){
      cnt2++;
    }
  }
  if(y%4==0&&(y%100!=0||y%400==0))t[2]--;

  return res+cnt2;
}


int main(){
  int a,b;
  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;
    a=calc(y[0],m[0],d[0]);
    b=calc(y[1],m[1],d[1]);
    cout<<b-a<<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 == 1) {
			daya1 += day2[b][c];
		}
		else {
			daya1 += day[b][c];
		}
		if (d % 4 == 1) {
			daya2 += day2[e][f];
		}
		else {
			daya2 += day[e][f];
		}
		cout << daya2 - daya1 << endl;
	}
}