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>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;

int mm1[] = {0,31,59,90,120,151,181,212,242,273,303,334};
int mm2[] = {0,31,60,91,121,152,182,213,243,274,304,335};
// ¼ïPNPPú©çÌú
ll days(int y, int m, int d) {
  y--;
  ll ret = y*365;
  ret += (y/4)-(y/100)+(y/400); // [N
  if (y%400==0||(y%4==0&&y%100!=0))
    ret += mm1[m-1];
  else
    ret += mm2[m-1];
  return ret+d;
}

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

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

int pm(int y, int m) {
    int sum = 0;
    int s[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for (int i = 0; i < m; i++) {
        sum += s[i];
        if (i == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) sum += 1;
    }
    return sum;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2,
           y1 > -1 && y2 > -1 && m1 > -1 && m2 > -1 && d1 > -1 && d2 > -1) {
        y1--;
        int t1 = y1 * 365 + (y1 / 400) - (y1 / 100) + (y1 / 4);
        y1++;
        t1 += d1;
        t1 += pm(y1, m1);

        y2--;
        int t2 = y2 * 365 + (y2 / 400) - (y2 / 100) + (y2 / 4);
        y2++;
        t2 += d2;
        t2 += pm(y2, m2);

        cout << t2 - t1 << 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,28,31,30,31,30,31,31,30,31,30,31};
	const int LEAPD[12]={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 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<stdio.h>
int main(void){
	int y1,m1,d1,y2,m2,d2;
	int i;
	int y1day,y2day;
	while(1){
		scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
		y1day=0;
		y2day=0;
		if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1  || d2==-1) {
			break;
		}
		y1day=y2day=0;
		for(i=1;i<y1;i++){
			y1day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y1day++;
		}
		for(i=1;i<m1;i++){
			y1day+=31;
			if(i==4 || i==6 || i==9 || i==11) y1day-=1;
			if(i==2){
				y1day-=1;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y1day-=1;
			}
		}
		y1day+=d1;
		for(i=1;i<y2;i++){
			y2day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y2day++;
		}
		for(i=1;i<m2;i++)	{
			y2day+=31;
			if(i==4 || i==6 || i==9 || i==11) y2day-=1;
			if(i==2){
				y2day-=1;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y2day-=1;
			}
		}
		y2day+=d2;
	//	printf("%d %d\n",y1day,y2day);
		printf("%d\n",y2day-y1day);
	}
	return 0;
}

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;
		}
		else
		{
			sum += 365;
		}
	}
	if((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)
	{
		isLeap = true;
	}
	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);
}

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,28,31,30,31,30,31,31,30,31,30,31};
	const int LEAPD[12]={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 days=0,tmp1=d1,tmp2=d2;
		for(int i=0;i<m1-1;++i) tmp1+=((isLeap(y1))?LEAPD[i]:D[i]);
		for(int i=0;i<m2-1;++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>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

int month[]={
  0,
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = y*365+d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    if ( i %400 == 0 ||
	 (i % 100 !=0 && i % 4 == 0))base++;
  }
  return base;
}


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 a=day(y1,m1,d1),b=day(y2,m2,d2);
    cout << b-a << endl;
  }
}

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

int main(){
  int i,j,y[2],m[2],d[2],ans,f;
  while(1){
    f = 0;
    for(i=0;i<2;i++){
      cin >> y[i] >> m[i] >> d[i];
      if(y[i] == -1 || m[i] == -1 || d[i] == -1) f++;
    }
    if(f != 0) break;

    ans = (y[1] - y[0]) * 365 + (m[1] - m[0]) * 30 + d[1] - d[0];

    for(i=m[0];i<=m[1];i++){
      if((i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) && i != m[1]) ans++;
    }

    for(i=y[0];i<=y[1];i++){
      if(i%4 == 0){
	if(i%400 == 0);
	else if(i%100 == 0) continue;
	if(i == y[0] && m[0] > 2) continue;
	else if(i == y[1] && m[0] <=2) continue;
	ans++;
      }
    }

    cout << ans << endl;

  }
  return 0;
}

C++: #include <iostream>

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

void solve()
{
	int y[2], m[2], d[2];
	while(cin >> y[0] >> m[0] >> d[0] >> y[1] >> m[1] >> d[1])
	{
		if(y[0] == -1 && m[0] == -1 && d[0] == -1 && y[1] == -1 && m[1] == -1 && d[1] == -1)
		{
			break;
		}
		int count[2] = {0, 0};
		for(int a = 0; a < 2; ++a)
		{
			for(int i = 0; i < y[a]; ++i)
			{
				if(i % 400 == 0 || (i % 100 != 0 && i % 4 == 0))
				{
					count[a]++;
				}
			}
		}
		for(int i = 0; i < 2; ++i)
		{
			y[i]--;
			m[i]--;
			d[i]--;
		}
		
		int day[2] = {0, 0};
		for(int a = 0; a < 2; ++a)
		{
			day[a] = y[a] * 365 + count[a] + d[a];
			for(int i = 0; i < m[a]; ++i)
			{
				day[a] += month[i];
			}
		}
		cout << day[1] - day[0] << endl;
	}
}

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