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;


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

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))
			{
				sum += days_leap[m1] - d1;
				
				REP(i,m1+1,13)
				{
					sum += days_leap[i];
				}

			}
			else
			{
				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;
}