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 ;

#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;
	}
}

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

int mc[12]={0,31,59,90,120,151,181,212,243,273,304,334};

long long dat(int y,int m,int d) {
	long long an;
	an=y*365+mc[m-1]+d+y/4-y/100+y/400;
	if (((y % 4==0 && y % 100!=0) || y % 400==0) && m<3) an--; 
	return an;
}

int main() {
    int y1,m1,d1,y2,m2,d2;
	long long d;
	while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
		if (y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0) break;
		d=dat(y2,m2,d2)-dat(y1,m1,d1);
		cout << d << endl;
	}
    return 0;
}

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

int f(int y,int m,int d){
	const int year = 365;
	int month[] = {31,28,31,30,31,30,31,31,30,31,30,31},c;
	c = 0;
	for(int i = 1;i < y;++i){
		c += year;
		if(i % 100 == 0){ 
			if(i % 400 == 0) ++c;
		}
		else if(i % 4 == 0) ++c; 
	}
	for(int i = 0;i < m - 1;++i){
		c += month[i];
		if(i == 1){
			if(y % 100 == 0){
				if(y % 400 == 0) ++c;
			}
			else if(y % 4 == 0) ++c;
		}
	}
	c += (d - 1);
	return c;
}

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

C++: #include<iostream>
#include<cstring>
#include<ctime>
using namespace std;
class Date{
	int y, m ,d;
public:
	bool GetDate(){
		cin >> y >> m >> d;
		if( y < 0 || m < 0 || d < 0 ) return false;
		else return true;
	}
	bool isLeap() const {
		return isLeap( y );
	}
	static bool isLeap(int y){
		return ( y % 4 == 0 && ( y % 100 != 0 || y % 400 == 0 ) );
	}
	unsigned int days() const {
		unsigned int ret = 0;
		const int md[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(int ty = 0; ty < y; ++ty){
			ret += isLeap( ty ) ? 366 : 365;
		}
		for(int tm = 1; tm < m; ++tm){
			ret += (isLeap() && tm == 2) ? 29 : md[tm];
		}
		ret += d;
		return ret;
	}
	unsigned int operator-(const Date &t) const {
		return this->days() - t.days();
	}
};
int main(void){
	while( true ){
		Date date1, date2;
		if( !date1.GetDate() || !date2.GetDate() )
			break;
		
		cout << date2 - date1 << '\n';
	}
	return 0;
}