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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll y1, m1, d1, y2, m2, d2;
  ll ch[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  ll ch2[2] = {28, 29};
  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
    if(y1 == (-1)) break;
    ll cnt = 0;
    if(y1 == y2 && m1 == m2 && d1 == d2) {
      cout << cnt << endl;
      continue;
    }
    ll ye = 0, webch = 0;
    bool che = false;
    while(1) {
      while(1) {
        if(che) break;
        if(m1 == 2) break;
        d1++;
        cnt++;
        if(d1 > ch[m1]) {
          m1++;
          d1 = 1;
          if(m1 > 12) {
            y1++;
            m1 = 1;
          }
        }
        if(y1 == y2 && m1 == m2 && d1 == d2) {
          che = true;
          break;
        }
      }
      ye = webch = 0;
      if(y1 % 4 == 0) {
        if(y1 % 100 != 0) ye = 1;
        if(y1 % 400 == 0) ye = 1;
      }
      while(1) {
        if(che) break;
        d1++;
        cnt++;
        if(d1 > ch2[ye]) {
          m1++;
          d1 = 1;
          webch = 1;
          break;
        }
        if(webch) break;
        if(y1 == y2 && m1 == m2 && d1 == d2) {
          che = true;
          break;
        }
      }
      if(che) break;
    }
    cout << cnt << endl;
  }
	return 0;
}

C++: #include <iostream>
using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}

C++: #include <bits/stdc++.h>
using namespace std;

int pm(int y, int m) {
    int sum = 0;
    int s[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for (int i = 0; i < m; i++) {
        sum += s[i];
        if (i == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) sum += 1;
    }
    return sum;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2,
           y1 != -1 && y2 != -1 && m1 != -1 && m2 != -1 && d1 != -1 && d2 != -1) {
        y1--;
        int t1 = y1 * 365 + (y1 / 400) - (y1 / 100) + (y1 / 4);
        y1++;
        t1 += d1;
        t1 += pm(y1, m1);

        y2--;
        int t2 = y2 * 365 + (y2 / 400) - (y2 / 100) + (y2 / 4);
        y2++;
        t2 += d2;
        t2 += pm(y2, m2);

        cout << t2 - t1 << endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

#define pb push_back
#define fr first
#define sc second
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> pip; 
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
  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 total1=0,total2=0;
    for(int i=0;i<y1;i++){
      if(i%4==0){
	if(i%100!=0 || i%400==0){
	  total1+=366;
	}
      }else{
	total1+=365;
      }
    }

    for(int i=0;i<y2;i++){
      if(i%4==0){
	if(i%100!=0 || i%400==0){
	  total2+=366;
	}
      }else{
	total2+=365;
      }
    }

    for(int i=1;i<m1;i++){
      if(i==2){
	if(y1%4==0){
	  if(y1%100!=0 || y1%400==0){
	    total1+=29;
	  }
	}
	else total1+=28;
      }
      else if(i==4 || i==6 || i==9 || i==11){
	total1+=30;
      }
      else total1+=31;
    }

    for(int i=1;i<m2;i++){
      if(i==2){
	if(y2%4==0){
	  if(y2%100!=0 || y2%400==0){
	    total2+=29;
	  }
	}
	else total2+=28;
      }
      else if(i==4 || i==6 || i==9 || i==11){
	total2+=30;
      }
      else total2+=31;
    }

    total1+=d1;
    total2+=d2;
    cout<< total2-total1<< endl;
  }
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

bool is_leap(int y)
{
	return y % 4 == 0 && y % 100 || y % 400 == 0;
}
int main()
{
	int days[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	int y[2], m[2], d[2];
	while (scanf("%d %d %d %d %d %d", &y[0], &m[0], &d[0], &y[1], &m[1], &d[1]),
		y[0] >= 0 && m[0] >= 0 && d[0] >= 0 && y[1] >= 0 && m[1] >= 0 && d[1] >= 0)
	{
		int dd[2];
		for (int i = 0; i < 2; ++i)
		{
			dd[i] = d[i];
			for (int j = 0; j < m[i]-1; ++j)
				dd[i] += days[j];
		}
		int ans = dd[1] - dd[0];
		ans += (y[1] - y[0]) * 365;
		for (int i = y[0]; i < y[1]; ++i)
		{
			if (is_leap(i))
				++ans;
		}
		if (is_leap(y[0]) && m[0] > 2)
			--ans;
		if (is_leap(y[1]) && m[1] > 2)
			++ans;

		printf("%d\n", ans);
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

bool isLeap(int i){
	return i % 400 == 0 
			? true : i % 100 == 0
			? false : i % 4 == 0
			? true : false;
}

int getSum(int y,int m,int d,const int* month){
	int sum=0;
	for(int i=0;i<y;i++){
		sum += isLeap(i) ? 366 : 365;
	}

	for(int i=1;i<m;i++){
		sum += i != 2 ? month[i] :
			isLeap(y) ? month[i] + 1 : month[i];
	}

	sum += d;

	return sum;
}

int main(){
	const int month[] = {-1,31,28,31,30,31,30,31,31,30,31,30,31};
	int y1, m1, d1, y2, m2, d2;
	while(~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;

		cout << abs(getSum(y1,m1,d1,month) - getSum(y2,m2,d2,month)) << endl;
	}
}