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>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e15+9
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

ll table[2][12] = { { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 ,31}
, { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30.31 } };

ll solve(ll y, ll m, ll d){
	ll res = 0, year = y;
	y--;
	res += (y / 400) * 146097;
	y %= 400;
	res += (y / 100) * 36524;
	y %= 100;
	res += (y / 4) * 1461;
	y %= 4;
	res += y * 365;
	if (year % 4 == 0){
		if (year % 400 != 0 && year % 100 == 0){
			REP(i, m - 1)res += table[0][i];
		}
		else{
			REP(i, m - 1)res += table[1][i];
		}
	}
	else{
		REP(i, m - 1)res += table[0][i];
	}
	res += d;
	return res;
}

int main(){
	ll a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f){
		if (a < 0 || b < 0 || c < 0 || d < 0 || e < 0 || f < 0)break;
		cout << solve(d, e, f) - solve(a, b, c) << endl;
	}
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int is_leap(int y){
  if(y % 400 == 0) return 366;
  else if(y % 100 == 0) return 365;
  else if(y % 4 == 0) return 366;
  return 365;
}
const int days[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int y,y2,d,d2,m,m2;
  while(cin >> y >> m >> d >> y2 >> m2 >> d2){
    if(y < 0 || m < 0 || d < 0 || y2 < 0|| m2 < 0|| d2 < 0) break;
    int ans = 0;
    rep(i,m){
      ans -= days[i];
    }
    if(is_leap(y) == 366 && m > 2) --ans;
    ans -= d;
    while(y2 - y != 0){
      ans += is_leap(y);
      ++y;
    }
    rep(i,m2){
      ans += days[i];
    }
    if(is_leap(y2) == 366 && m2 > 2) ++ans;
    ans += d2;
    cout << ans << endl;
  }
  return 0;
}

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

int t0[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int t1[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

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

class Date{
public:
  int y, m, d;

  Date(){}
  Date(int _y, int _m, int _d){
    y = _y;
    m = _m;
    d = _d;
  }

  bool operator==(const Date &date)const{
    return y == date.y && m == date.m && d == date.d;
  }

  void inc(){
    d++;

    if(isLeap(y) && t1[m] < d || !isLeap(y) && t0[m] < d){
      d = 1;
      m++;
    }
    if(12 < m){
      m = 1;
      y++;
    }
  }
};

int main(){
  Date date1, date2;

  while(cin >> date1.y >> date1.m >> date1.d >> date2.y >> date2.m >> date2.d){
    if(date1.y == -1) break;

    int ans = 0;

    while(!(date1 == date2)){
      date1.inc();
      ans++;
    }

    cout << ans << endl;
  }
}

C++: #include <iostream>

using namespace std;

int main() {
	int y,m,d,Y,M,D,i,b,c,yday,mday,day;
	int sum,n,uru,nuru;
	for(;;){
		
		if(y==-1||m==-1||d==-1||Y==-1||M==-1||y==-1){
			break;
		}
		
		
	
	cin>>y>>m>>d>>Y>>M>>D;
	
	
	
	
	yday=(Y-y)*365;
	mday=(M-m)*30;
	day=D-d;
	uru=(Y-y)/4;
	if(y%4==0){
		uru=uru+1;
	}
	
	if(1900>y&&Y>=1900){
		uru=uru-1;
	}if(2100>y&&Y>=2100){
		uru=uru-1;
	}if(2200>y&&Y>=2200){
		uru=uru-1;
	}if(2300>y&&Y>=2300){
		uru=uru-1;
	}if(2500>y&&Y>=2500){
		uru=uru-1;
	}if(2600>y&&Y>=2600){
		uru=uru-1;
	}if(2700>y&&Y>=2700){
		uru=uru-1;
	}if(2900>y&&Y>=2900){
		uru=uru-1;
	}
	
	sum=yday+mday+day+uru;
	
	if(m<=2&&2<=M&&m!=M){
		sum+=1;
	}
	if(m<=4&&4<=M&&m!=M){
		sum+=1;
	}
	if(m<=6&&6<=M&&m!=M){
		sum+=1;
	}
	if(m<=9&&9<=M&&m!=M){
		sum+=1;
	}
	if(m<=12&&12<=M&&m!=M){
		sum+=1;
	}
	
	
	if(Y%400==0&&y%400==0&&Y!=y){
		
		sum=sum+1;
	}
	
	if(sum!=0){
	cout<<sum<<endl;
	}
}
	return 0;
}

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[e][f];
		}
		else {
			daya2 += day[e][f];
		}
		cout << daya2 - daya1 << endl;
	}
}