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 "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)

//verified
class date{
public:
    int y,m,d;
    
    date(int _y=0, int _m=0, int _d=0):y(_y),m(_m),d(_d){};
    
    bool isLeap(){ return y%400==0||(y%4==0&&y%100); }
    
    date operator + (const int day)const{
        int days_of_month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
        date t = *this;
        t.d+=day;
        if(  days_of_month[t.m]+(t.isLeap()&&t.m==2) >= t.d  )return date(t.y,t.m,t.d);
        int dom;
        while(  (dom = days_of_month[t.m]+(t.isLeap()&&t.m==2)) < t.d  ){
            t.d -= dom;
            if(t.m==12) t.y++,t.m=1;
            else        t.m++;
        }
        return t;
    }
    
    bool operator > (const date &date)const{
        int ymd1[] = {y,m,d};
        int ymd2[] = {date.y,date.m,date.m};
        rep(i,3){
            if(ymd1[i]>ymd2[i])return true;
            if(ymd1[i]<ymd2[i])return false;
        }
        return false;
    }
    
    bool operator == (const date &date)const{ return (y==date.y && m==date.m && d==date.d); }
    bool operator != (const date &date)const{ return !(*this==date); }
    bool operator <  (const date &date)const{ return ( !(*this>date) && !(*this==date) ); }
};



int main(){
    while(1){
        date ymd[2];
        rep(i,2)cin>>ymd[i].y>>ymd[i].m>>ymd[i].d;
        if(ymd[0].y==-1)break;
        if(ymd[0]>ymd[1])swap(ymd[0],ymd[1]);
        
        int c=0;
        while(ymd[0]!=ymd[1]){
            c++;
            ymd[0] = ymd[0]+1;
        }
        cout<<c<<endl;
    }
    
}

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

// infty
#define ULLINF (ULLONG_MAX)
#define LLINF  (LLONG_MAX)
#define IINF   (INT_MAX)
#define INF    (1<<29)

// math
#define Sq(x) ((x)*(x))

// container utility
#define ALL(x) (x).begin(), (x).end()
#define MP make_pair
#define PB push_back
#define EACH(it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();it++)

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

// typedef
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef vector<VI> VVI;

typedef long long ll;

// pair util
#define FST first
#define SND second

// range validator
#define CK(n,a,b) (a<=n && n<b)

// conversion
template<class T> inline string toStr(T a) { ostringstream oss_; oss_ << a; return oss_.str(); }
inline int toInt(string s) { return atoi(s.c_str()); }

// prime
bool isPrime(int a) { for(int i=2; i*i <=a; i++) if(a%i == 0) return false; return true; }

int const dx[] = {-1,0,1,0,-1,1,1,-1};
int const dy[] = {0,-1,0,1,-1,-1,1,1};

//////////////////////////////////////////////////////////////


int FairField(int y,int m,int d)
{
  // adjust
  if(m <= 2) {
    y --;
    m += 12;
  }
  
  int U = y/4 - y/100 + y/400;
  return 365*y + U + 153*(m+1)/5 + 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;
  }
  
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


bool checkUru(const int y){
	if(y%4==0){
		if(y%100==0){
			if(y%400==0){
				return true;
			}
			else{
				return false;
			}
		}
		else
			return true;
	}
	else
		return false;
}

int main(){

	const int md[]={0,31,28,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&&(y1>=0&&m1>=0&&d1>=0&&y2>=0&&m2>=0&&d2>=0)){
		int sum=0;
		if(y1!=y2){
			for(int y = y1+1; y < y2; y++){
				if(checkUru(y)){
					sum+=366;
				}
				else
					sum+=365;
			}
			// y1ツづ2ツづ可づつつ「ツづ計ツ算
			if(checkUru(y1)){
				sum+=(md[m1]-d1);
				if(m1==2)
					sum++;
				for(int m=m1+1; m<=12; m++){
					if(m==2)
						sum++;
					sum+=md[m];
				}
			}
			else{
				sum+=(md[m1]-d1);
				for(int m=m1+1; m<=12; m++){
					sum+=md[m];
				}
			}
			
			if(checkUru(y2)){
				sum+=(d1);

				for(int m=1; m<m2; m++){
					if(m==2)
						sum++;
					sum+=md[m];
				}
			}
			else{
				sum+=(d1);
				for(int m=1; m<m2; m++){
					sum+=md[m];
				}
			}
		}
		else{
			if(m1!=m2){
				for(int m=m1+1; m < m2; m++){
					if(checkUru(y1)&&m==2){
						sum+=29;
					}
					else
						sum+=md[m];
				}
				// m1ツづ2ツづ可づつつ「ツづ計ツ算
				if(checkUru(y1)&&m1==2){
					sum+=(md[m1]-d1)+1;
				}
				else
					sum+=(md[m1]-d1);

				// m2
				sum+=d2;

			}
			else{
				sum+=d2-d1;
			}
		}
		cout<<sum<<endl;
	}

	return 0;
}

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, 28, 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++: #include <iostream>
#include<cstdio>
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(2000<=y&&Y>=2100){
		uru=uru-1;
	}if(2100<=y&&Y>=2200){
		uru=uru-1;
	}if(2200<=y&&Y>=2300){
		uru=uru-1;
	}if(2300<=y&&Y>=2400){
		uru=uru-1;
	}if(2400<=y&&Y>=2500){
		uru=uru-1;
	}if(2500<=y&&Y>=2600){
		uru=uru-1;
	}if(2600<=y&&Y>=2700){
		uru=uru-1;
	}if(2800<=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){
	printf("%d\n",sum);
	}
}
	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++;
	for(int i=0;i<m-1;i++)res+=days[i];
	y--;
	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){
		if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0)break;
		cout<<calc(y2,m2,d2)-calc(y1,m1,d1)<<endl;
	}
	return 0;
}