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 days[20];

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

int calc(int y, int m, int d){
	days[2] = isLeap(y) ? 29 : 28;
	int sum = 0;
	for(int i=1;i<m;i++)sum += days[i];
	sum += d;
	return sum;
}

int cereal(int y, int m, int d){
	if(y == 0)return calc(y, m, d);
	int sy = y - 1;
	int ly = sy / 4 - sy / 100 + sy / 400 + 1;
	int ny = y - ly;
	int sum = ly * 366 + ny * 365 + calc(y, m, d);
	return sum;
}

int main(){
	for(int i=1;i<=12;i++)days[i] = 31;
	days[4] = days[6] = days[9] = days[11] = 30;

	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 << cereal(y2, m2, d2) - cereal(y1, m1, d1) << endl;
	}
	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<0||m1<0||d1<0||y2<0||m2<0||d2<0)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 <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair

static int GetDays(int y,int m,int d){
  if(m<=2){
    --y;
    m+=12;
  }
  int dy=365*(y-1);
  int c=y/100;
  int dl=(y>>2)-c+(c>>2);
  int dm=(m*979-1033)>>5;
  return dy+dl+dm+d-1;
}

int main(){
  int y1,y2,m1,m2,d1,d2;
  while(1){
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    if(y1==-1)break;
    cout<<GetDays(y2,m2,d2)-GetDays(y1,m1,d1)<<endl;
  }
  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=0;
	for(int i=1;i<y;i++){
		if(i%4==0&&(i%100||i%400==0))res+=366;
		else res += 365;
	}
	for(int i=1;i<m;i++){
		res += days[i-1];	
	}
	if(2<m && y%4==0&&(y%100||y%400==0))res++;
	return res+d-1;
}

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

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

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

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 day1 = 0,day2 = 0;

    //day
    day1 += d1;
    day2 += d2;

    //month
    for(int i=1;i<m1;i++) {
      day1 += month[i];
    }
    for(int i=1;i<m2;i++) {
      day2 += month[i];
    }

    //year
    for(int i=1;i<y1;i++) {
      if(i % 4 == 0) {
        if(i % 100 == 0 && i % 400 != 0){
          day1 += 365;
        }
        else {
          day1 += 366;
        }
      }
      else {
        day1 += 365;
      }
    }

    for(int i=1;i<y2;i++) {
      if(i % 4 == 0) {
        if(i % 100 == 0 && i % 400 != 0){
          day2 += 365;
        }
        else {
          day2 += 366;
        }
      }
      else {
        day2 += 365;
      }
    }

    cout << day2-day1 << endl;
  }
}

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

int main()
{
  int y1,m1,d1,y2,m2,d2;
  int m[12]={31,28,31,30,31,30,31,31,30,31,30,31},i;
  int days1,days2;
  for(i=1;i<12;i++)m[i]+=m[i-1];
  while(cin>>y1>>m1>>d1>>y2>>m2>>d2,~y1&~m1&~d1&~y2&~m2&~d2){
    days1=365*y1+m[m1-1]+d1+y1/4-y1/100+y1/400;
    if( (y1%4==0 && y1%100!=0) || (y1%400==0) ){
      if(m1==2&&d1==29){
      }else if(m1<=2){
	days1--;
      }
    }
    days2=365*y2+m[m2-1]+d2+y2/4-y2/100+y2/400;
    if( (y2%4==0 && y2%100!=0) || (y2%400==0) ){
      if(m2==2&&d2==29){
      }else if(m2<=2){
	days2--;
      }
    }
    cout<<days2-days1<<endl;
  }
}

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

int main()
{
  int y1,m1,d1,y2,m2,d2;
  int m[12]={31,28,31,30,31,30,31,31,30,31,30,31},i;
  int days1,days2,difference;
  for(i=1;i<12;i++)m[i]+=m[i-1];
  while(cin>>y1>>m1>>d1>>y2>>m2>>d2,~y1&~m1&~d1&~y2&~m2&~d2){
    days1=365*y1+m[m1-1]+d1+y1/4-y1/100+y1/400;
    days2=365*y2+m[m2-1]+d2+y2/4-y2/100+y2/400;
    difference=days2-days1;
    if( (y1%4==0 && y1%100!=0) || (y1%400==0) ){
      if(m1==2&&d1==29){
      }else if(m1<=2){
	difference++;
      }
    }
    if( (y2%4==0 && y2%100!=0) || (y2%400==0) ){
      if(m2==2&&d2==29){
	difference++;
      }else if(m2>=3){
	difference++;
      }
    }
    cout<<difference<<endl;
  }
}

C++: #include <iostream>

using namespace std;
static const int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int day_count(int y, int m, int d)
{
	bool isLeap = false;
	int sum = 0;
	for(int i = 1; i < y; ++i)
	{
		if((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
		{
			sum += 366;
			isLeap = true;
		}
		else
		{
			sum += 365;
		}
	}
	for(int i = 0; i < m - 1; ++i)
	{
		if(i == 1 && isLeap)
		{
			++sum;
		}
		sum += month[i];
	}
	sum += d;
	return(sum);
}

void solve()
{
	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;
		}
		cout << day_count(y2, m2, d2) - day_count(y1, m1, d1) << endl;
	}
}

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