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 <string>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

bool leap(int y)
{
	if(y % 400 == 0)
	{
		return true;
	}
	else if(y % 100 != 0 && y % 4 == 0)
	{
		return true;
	}
	return false;
}

int main()
{
	int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	int days_leap[13] = {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 sum = 0;

		if(y2 - y1 == 0)
		{
			if(m2 - m1 == 0)
			{
				sum += d2 - d1;
			}
			else
			{
				if(leap(y1))
				{
					sum += days_leap[m1] - d1;
					REP(i,m1+1,m2)
					{
						sum += days_leap[i];
					}
					sum += d2;
				}
				else
				{
					sum += days[m1] - d1;

					REP(i,m1+1,m2)
					{
						sum += days[i];
					}

					sum += d2;
				}
			}
		}
		else
		{
			if(leap(y1))
			{
				REP(i,1,m1)
				{
					sum += days_leap[i];
				}

				sum += days_leap[m1] - d1;
				
				REP(i,m1+1,13)
				{
					sum += days_leap[i];
				}

			}

			else
			{
				REP(i,1,m1)
				{
					sum += days[i];
				}
		
				sum += days[m1] - d1;

				REP(i,m1+1,13)
				{
					sum += days[i];
				}
			
			}

			REP(i,y1+1,y2)
			{
				if(leap(i))
				{
					sum += 366;
				}
				else
				{
					sum += 365;
				}
			}

			if(leap(y2))
			{
				REP(i,1,m2)
				{
					sum += days_leap[i];
				}
				sum += d2;
			}
			else
			{
				REP(i,1,m2)
				{
					sum += days[i];
				}
				sum += d2;
			}

		}

		cout << sum << endl;
	}
	return 0;
}

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


int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int calc(int y,int m,int d){
	int res=d-1;
	if(2<m && y%4==0&&(y%100||y%400==0))res++;	
	y--;m--;	
	for(int i=0;i<m;i++)res+=days[i];	
	res+=y/400*146097;
	y%=400;
	res+=y/100*36524;
	y%=100;
	res+=y/4*1461;
	y%=4;
	res+=y*365;
	return res;
}

int main(){
	int y1,m1,d1,y2,m2,d2;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
		cout<<calc(y2,m2,d2)-calc(y1,m1,d1)<<endl;
	}
	return 0;
}

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

int fairfield(int y, int m, int d){
  if(m == 1 || m == 2){
    y = y--;
    m = m + 12;
  }

  return 365 * y + y / 4 - y / 100 + y / 400 + 306 * (m + 1) / 10 + d - 428;
}

int main(){
  int y1, m1, d1, y2, m2, d2;

  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2){
    if(y1 == -1) break;
    cout << fairfield(y2, m2, d2) - fairfield(y1, m1, d1) << 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 <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);
  ll 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;
    ll 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<bits/stdc++.h>
using namespace std;
int main()
{
    int year[2],month[2],day[2];
    while(cin>>year[0]>>month[0]>>day[0]>>year[1]>>month[1]>>day[1]){
        bool en=0;
        for(int i=0;i<2;i++)if(year[i]<0||month[i]<0||day[i]<0)en=1;
        if(en)break;
        int ans=0;
        for(int i=year[0];i<=year[1];i++){
            ans+=365;
            if(i%4==0&&i%100!=0||i%400==0)ans+=1;
        }
        ans+=day[1]-day[0];
        for(int i=1;i<month[0];i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        if((year[0]%4==0&&year[0]%100!=0||year[0]%400==0)&&month[0]>=2)ans-=1;
        for(int i=month[1];i<13;i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        if((year[1]%4==0&&year[1]%100!=0||year[1]%400==0)&&month[1]<=2)ans+=1;
        cout<<ans<<endl;
    }
}