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 x[5000000], 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 < 5000000; 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 && a % 100>0) || a % 400 == 0) {
			daya1 += day2[b][c];
		}
		else {
			daya1 += day[b][c];
		}
		if ((d % 4 == 0 && d % 100>0) || d % 400 == 0) {
			daya1 += day2[b][c];
		}
		else {
			daya2 += day[e][f];
		}
		cout << daya2 - daya1 << endl;
	}
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
ll days(int y,int m,int d)
{
        return 365*y+(y/4)-(y/100)+(y/400)+((306*(m+1))/10)+d-429;
}
int main()
{
        while(1)
        {
                int y1,m1,d1,y2,m2,d2;
                cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
                if(y1==-1)break;
                if(m1<=2)y1--,m1+=12;
                if(m2<=2)y2--,m2+=12;
                //cout << days(y,m,d) << endl;
                cout << days(y2,m2,d2)-days(y1,m1,d1) << endl;
        }
        return 0;
}

C++: 
#include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

int month[]={
  0,
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    y+=365;
    if ( i %400 == 0 ||
	 (i % 100 !=0 && i % 4 == 0))base++;
  }
  return base;
}



/*
  correct version
int day(int y,int m,int d){
  y += 4800;
  if (m < 3) --y, m += 12;
  return 365L*y+y/4-y/100+y/400+(153*m-457)/5+d-32045;
}
*/

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 a=day(y1,m1,d1),b=day(y2,m2,d2);
    cout << b-a << endl;
  }
}

C++: #include <iostream>
using namespace std;
 
int day(int y, int m, int d) {
  int ans = 0;
  for(int i = 1; i < y; i++) {
    bool uruu = false;
    if(i % 4 == 0) {
      if(i % 100 == 0) {
    if(i % 400 == 0) {
      uruu = true;
    }
      } else {
    uruu = true;
      }
    }
    if(uruu) {
      ans += 366;
    } else {
      ans += 365;
    }
  }
  m--;
  if(m >= 1) ans += 31;
  if(m >= 2) {
    bool uruu = false;
    if(y % 4 == 0) {
      if(y % 100 == 0) {
    if(y % 400 == 0) {
      uruu = true;
    }
      } else {
    uruu = true;
      }
    }
    if(uruu) ans += 29;
    else     ans += 28;
  }
  if(m >= 3) ans += 31;
  if(m >= 4) ans += 30;
  if(m >= 5) ans += 31;
  if(m >= 6) ans += 30;
  if(m >= 7) ans += 31;
  if(m >= 8) ans += 31;
  if(m >= 9) ans += 30;
  if(m >= 10) ans += 31;
  if(m >= 11) ans += 30;
 
  ans += d;
 
  return ans;
}
 
int main() {
  int y1, m1, d1;
  int y2, m2, d2;
  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
    if(y1 == -1 && m1 == -1 && d1 == -1 && y2 == -1 && m2 == -1 && d2 == -1)
      break;
 
    cout << day(y2,m2,d2) - day(y1,m1,d1) << endl;
  }
  return 0;
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int cal[10001];
	int month[13];
	month[1]=month[3]=month[5]=month[7]=month[8]=month[10]=month[12]=31;
	month[4]=month[6]=month[9]=month[11]=30;
	loop(i,0,10001){
		if(i%4==0){
			if(i%100==0){
				if(i%400==0){
					cal[i]=1;
				}else cal[i]=0;
			}else cal[i]=1;

		}else cal[i]=0;
	}
	int ay,am,ad,by,bm,bd;
	while(1){
		cin>>ay>>am>>ad>>by>>bm>>bd;
		if(ay<0 || am<0 || ad<0 || by<0 || bm<0 || bd<0)break;
		int ans=0;
		loop(j,ay+1,by){
			if(cal[j]==1){
				ans+=366;
			}else ans+=365;
		}
		if(ay!=by){
			loop(j,am+1,13){
				if(j==2){
					if(cal[ay]=1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
			loop(j,1,bm){
				if(j==2){
					if(cal[by]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}else{
			loop(j,am+1,bm){
				if(j==2){
					if(cal[am]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}
		if(am!=bm){
			ans+=(month[am]-ad);
			ans+=bd;
		}else if(ay==by){
			ans+=(bd-ad);
		}else{
			ans+=(month[am]-ad);
			ans+=bd;
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int y1,m1,d1,y2,m2,d2,cnt,u,r;
  int d[13]={0,32,29,32,31,32,31,32,32,31,32,31,32};
  while(1){
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0) break;
    cnt=0;
    while(1){
      if(y1==y2&&m1==m2&&d1==d2) break;
      u=0;
      if(y1%400==0) u=1;
      else if(y1%100==0) u=0;
      else if(y1%4==0) u=1;
      if(u==1&&m1==2){
	if(d1==d[m1]+1){
	  m1++;
	  d1=1;
	}else{
	  cnt++;
	  d1++;
	}
      }else{
	if(d1==d[m1]){
	  if(m1==12) m1=1,y1++;
	  else m1++;
	  d1=1;
	}else{
	  cnt++;
	  d1++;
	}
      }
    }
    cout << cnt << endl;
  }
  return 0;
}

C++: #include <iostream>
#define IF(i) if(i%400==0||(i%100&&i%4==0))
using namespace std;
int c(int y,int m,int d)
{
	int ct=(m-1)*30+d;
	for(int i=1;i<m;i++) if(!(i==2||i==4||i==6||i==9|i==11)) ct++;
	if(m>2){
		IF(y) ct--;
		else ct-=2;
	}
	return(ct);
}
int main()
{
	int i;
	int y1,m1,d1,y2,m2,d2;
	while (cin>>y1>>m1>>d1>>y2>>m2>>d2){
		if(y1<0) break;
		int o=(y2-y1)*365;
		for (i=y1;i<y2;i++) IF(i) o+=1;
		o = o - c(y1,m1,d1) + c(y2,m2,d2);
		cout << o << endl;
	}
	return 0;
}