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 <cstdio>
int getdaycount(int y,int m,int d){
	int res=0,u;
	u=(y%4==0)&&((y%100!=0)||(y%400==0));
	for(int i=1;i<y;i++){
		res+=365;if((i%4==0)&&((i%100!=0)||(i%400==0))) res+=1;
	}
	for(int i=1;i<m;i++){
		res+=31;
		if(i==4||i==6||i==9||i==11) res--;
		if(i==2){res-=3;if(u)res++;}
	}
	for(int i=1;i<d;i++){
		res+=1;
	}
	return res;
}

int main(){
	int y1,m1,d1,y2,m2,d2;
	while(1){
		scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
		if(y1<0) return 0;
		printf("%d\n",getdaycount(y2,m2,d2)-getdaycount(y1,m1,d1));
	}
	return 0;
}

C++: #include <iostream>

using namespace std;


int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int l_month[12]={31,29,31,30,31,30,31,31,30,31,30,31};

bool leap(int year) {

  if((year%4==0 && year%100!=0) || year%400==0) return true;

  else return false;

}

int main() {

  int y1,m1,d1,y2,m2,d2;

  int sum1,sum2;


  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {

    if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1 || d2==-1) break;

    
    if(y1==y2) {

      if(leap(y1)==true) {

	sum1=0;

	for(int i=0;i<m1-1;i++) sum1+=l_month[i];

	sum1+=d1;

	sum2=0;

	for(int i=0;i<m2-1;i++) sum2+=l_month[i];

	sum2+=d2;

	cout << sum2-sum1 << endl;

      }

      else {

	sum1=0;

	for(int i=0;i<m1-1;i++) sum1+=month[i];

	sum1+=d1;

	sum2=0;

	for(int i=0;i<m2-1;i++) sum2+=month[i];

	sum2+=d2;

	cout << sum2-sum1 << endl;

      }

    }

    else {

      if(leap(y1)==true) {

	sum1=0;

	for(int i=0;i<m1-1;i++) sum1+=l_month[i];

	sum1+=d1;

	sum2=0;

	for(int i=y1;i<y2;i++) {

	  if(leap(i)==true) sum2+=366;

	  else sum2+=365;

	}

	if(leap(y2)==true) {

	  for(int i=0;i<m2-1;i++) sum2+=l_month[i];

	}

	else {

	  for(int i=0;i<m2-1;i++) sum2+=month[i];

	}

	cout << sum2-sum1+1 << endl;

      }

      else {

	sum1=0;

	for(int i=0;i<m1-1;i++) sum1+=month[i];

	sum1+=d1;

	sum2=0;

	for(int i=y1;i<y2;i++) {

	  if(leap(i)==true) sum2+=366;

	  else sum2+=365;

	}

	if(leap(y2)==true) {

	  for(int i=0;i<m2-1;i++) sum2+=l_month[i];

	}

	else {

	  for(int i=0;i<m2-1;i++) sum2+=month[i];

	}

	cout << sum2-sum1+1 << endl;

      }
    }

  }

  return 0;

}

C++: #include <iostream>
using namespace std;
int main( void )
{
	const int dom[12] = { 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 )
	{
		if ( y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0 )
			break;

		int uru = 0;
		for ( int i = y1; i < y2; i++ )
		{
			if ( i % 4 == 0 )
			{
				if ( i % 100 != 0 )
				{
					uru ++;
				}
				else if ( i % 400 == 0 )
				{
					uru ++;
				}
			}
		}

		int days = ( y2 - y1 ) * 365 + uru;
		for ( int i = m1; i < m2; i++ )
		{
			days += dom[i];
		}

		days += d2 - d1;

		cout << days << endl;

	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

const int days[13] = {
  0,
  31, 28, 31, 30, 31, 30,
  31, 31, 30, 31, 30, 31
};

inline bool IsLeap(const int year) {
  return (year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0));
}

int main() {
  printf("%s\n", (IsLeap(2004))?"yes":"no");
  int y1, m1, d1, y2, m2, d2;
  while (scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)) {
    //printf("%d %d\n", y1, y2);
    if (y1 == -1) break;
    int dist = 0;
    if (y1 != y2) {
      dist += days[m1] - d1 + 1;
      if (m1 != 12) {
        for (int i = m1+1; i <= 12; ++i) {
          dist += days[i];
          if (i == 2 && IsLeap(y1)) dist++;
        }
      }
      d1 = m1 = 1;
      y1++;
      for (; y1 < y2; ++y1) {
        dist += 365;
        if (IsLeap(y1)) dist++;
      }
    } else {
      if (m1 == m2) {
        cout << d2 - d1 << endl; continue;
      } else {
        dist += days[m1] - d1 + 1;
        m1++;
      }
    }
    // same year
    for (; m1 < m2; ++m1) {
      dist += days[m1];
    }
    dist += d2 - 1;
    printf("%d\n", dist);
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int isLeap(int y){
	if((y%=400)==0)return 1;
	if((y%=100)==0)return 0;
	if(((y%=4)==0))return 1;
	return 0;
}
int main(){
	const int D[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	const int LEAPD[12]={31,30,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==-1||m1==-1||d1==-1||y2==-1||m2==-1||d2==-1)break;
		int days=0,tmp1=d1,tmp2=d2;
		for(int i=0;i<m1;++i) tmp1+=((isLeap(y1))?LEAPD[i]:D[i]);
		for(int i=0;i<m2;++i) tmp2+=((isLeap(y2))?LEAPD[i]:D[i]);
		for(int i=y1;i<y2;++i) days+=((isLeap(i))?366:365);
		cout<<(days-tmp1+tmp2)<<"\n";
	}
	return 0;
}

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

using namespace std;

int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

// 1??´1???1??\???????????\??°
long long int day_sum(int y, int m, int d){
	long long int ans;
	ans = 0;
	
	y--;
	
	ans += y * 365;
	ans += (y / 4 - y / 100 + y / 400);
	
	for(int i = 0; i < m - 1; i++){
		ans += days[i];
	}
	ans += d - 1;
	if(((y % 4 == 0) * 2 - 1) * ((y % 100 == 0) * 2 - 1) * ((y % 400 == 0) * 2 - 1) > 0){
		if(m >= 3){
			ans++;
		}
	}
	return ans;
}

int main(){
	
	int y1, m1, d1, y2, m2, d2;
	while(true){
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0){
			break;
		}
		printf("%lld\n", day_sum(y2, m2, d2) - day_sum(y1, m1, d1));
	}
	
	return 0;
}

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

int fairfield(int y, int m, int d) {
	y--;
	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, y1 > 0) {
		cout << fairfield(y2, m2, d2) - fairfield(y1, m1, d1) << endl;
	}
	return 0;
}