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>
using namespace std;
typedef long long ll;

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

ll calc(int,int,int);

int main(){
  ll a,b;

  while(cin>>y[0]>>m[0]>>d[0]>>y[1]>>m[1]>>d[1]&&y[0]&&m[0]&&d[0]&&y[1]&&m[1]&&d[1]){
    a=calc(y[0],m[0],d[0]);
    b=calc(y[1],m[1],d[1]);
    cout<<b-a<<endl;
  }
}

ll calc(int y,int m,int d){
  int t[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

  //365+365+365+366==1461   4year
  //1461*25-1==36524      100year
  //36524*4+1==146097     400year
  if(y%4==0&&(y%100!=0||y%400==0)){
    t[2]=29;
  }
  y++;
  ll res=0;
  res+=146097*(y/400);y%=400;
  res+=36524*(y/100);y%=100;
  res+=1461*(y/4);y%=4;
  res+=365*y;

  int cnt=0;
  for(int i=m;i<=12;i++){
    for(int j=(i==m?d:1);j<=t[i];j++){
      cnt++;
    }
  }
  
  //cout<<cnt<<endl;
  return res-cnt;
}

C++: #include <iostream>
using namespace std;int day(int y,int m,int d){
    int i,i2,ans=0;
    for(i=1;i<y;i++){
        if(i%4==0&&(i%100!=0||i%400==0))ans+=366;
        else ans+=365;
    }
    for(i=1;i<m;i++){
        if(i==4||i==6||i==9||i==11)ans+=30;
        else if(i==2){
            if(y%4==0&&(y%100!=0||y%400==0))ans+=29;
            else ans+=28;
        }
        else ans+=31;
    }
    ans+=d;
    return ans;
}
int main(void){
    int y1,y2,m1,m2,d1,d2;
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    while(y1!=-1){
        cout<<abs(day(y1,m1,d1)-day(y2,m2,d2))<<endl;
        cin>>y1>>m1>>d1>>y2>>m2>>d2;
    }
}

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 <iostream>
using namespace std;

//ツ誕ツ青カツ年ツづ債。ツ年ツづ個端ツ青板づ個禿コツ青板づーツ計ツ算ツつキツづゥツづ個づ可猟伉用ツつキツづゥ
int monthList[] = {31,28,31,30,31,30,31,31,30,31,30};

bool is_leapyear(int y){
	return ( y%4 == 0 && ( y%100 != 0 || y%400 == 0 ) )? true : false ;
}

int add_day1(int m1, int d1){
	int cnt = 0;
	for(int i=0 ; i < m1 - 1 ; i++ ){
		cnt += monthList[i];
	}
	cnt += d1 - 1;
	return (365 - cnt);
}

int add_day2(int y1, int y2){
	int cnt = 0;
	for(int i = y1 + 1 ; i < y2 ; i++ ){
		cnt += (is_leapyear(i))? 366 : 365 ;
	}
	return cnt;
}

int add_day3(int y2 ,int m2 ,int d2 ){
	int cnt = 0;
	for(int i=0 ; i < m2 - 1 ; i++ ){
		cnt += monthList[i];
		if( is_leapyear( y2 ) && i ){
			cnt++;
		}
	}
	return (cnt + d2 - 1);
}

int main(){
	int y1, m1, d1, y2, m2, d2;
	while( cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 ){
		if( y1 == -1 ) break;
		
		int ans = 0;
		ans += add_day1( m1 , d1 );
		ans += add_day2( y1 , y2 );
		ans += add_day3( y2 , m2 , d2 );
		if( is_leapyear( y1 ) && m1 <= 2 ){
    	    ans++;
    	}
    	if( y1 == y2 ){
    		ans -= 365;
    	}
		cout << ans << 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);
  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-1){
      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-1){
      ans += days[i];
    }
    if(is_leap(y2) == 366 && m2 > 2) ++ans;
    ans += d2;
    cout << ans << endl;
  }
  return 0;
}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>

using namespace std;

bool isLeap(int year)
{
    if (year % 400 == 0)
    {
        return true;
    }
    
    if (year % 100 == 0)
    {
        return false;
    }
    
    return (year % 4 == 0);
}

long long dateSerial(int year, int month, int day)
{
    static int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    
    long long res = day;
    
    for (int i = 0; i < month - 1; i++)
    {
        res += days[i];
        
        if(isLeap(year) && i == 1)
        {
            res++;
        }
    }
    
    for (int i = 1; i < year; i++)
    {
        res += 365;
       
        if (isLeap(i))
        {
            res++;
        }
    }
    
    return res;
}

void Solution()
{
    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;
        }
        
        long long date1 = dateSerial(y1, m1, d1);
        long long date2 = dateSerial(y2, m2, d2);
        
        cout<<date2 - date1<<endl;
    }
}

int main()
{
    Solution();
    return 0;
}