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<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int cal[100000];
	int month[13];
	month[1]=month[3]=month[5]=month[7]=month[8]=month[10]=month[12]=31;
	month[4]=month[6]=month[9]=month[11]=30;
	loop(i,0,100000){
		if(i%4==0){
			if(i%100==0){
				if(i%400==0){
					cal[i]=1;
				}else cal[i]=0;
			}else cal[i]=1;

		}else cal[i]=0;
	}
	int ay,am,ad,by,bm,bd;
	while(1){
		cin>>ay>>am>>ad>>by>>bm>>bd;
		if(ay<0 || am<0 || ad<0 || by<0 || bm<0 || bd<0)break;
		long long ans=0;
		loop(j,ay+1,by){
			if(cal[j]==1){
				ans+=366;
			}else ans+=365;
		}
		if(ay!=by){
			loop(j,am+1,13){
				if(j==2){
					if(cal[ay]=1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
			loop(j,1,bm){
				if(j==2){
					if(cal[by]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}else{
			loop(j,am+1,bm){
				if(j==2){
					if(cal[am]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}
		if(am!=bm){
			ans+=(month[am]-ad);
			ans+=bd;
		}else if(ay==by){
			ans+=(bd-ad);
		}else{
			ans+=(month[am]-ad);
			ans+=bd;
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <functional>
#include <algorithm>
using namespace std;

typedef long long ll;

int days[2][12] = {
    {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
    {31, 29, 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 && y1 != -1) {
        int ret = 0, m = m1, y = y1;
        for(;;) {
            int f;
            if(y % 4 == 0) {
                if(y % 100 == 0) {
                    if(y % 400 == 0) {
                        f = 1;
                    } else {
                        f = 0;
                    }
                } else {
                    f = 1;
                }
            } else {
                f = 0;
            }
            
            if(y == y2 && m == m2) {
                ret += d2 - d1;
                break;
            } else {
                ret += days[f][m - 1];
            }
            
            if(m == 12) {
                y++; m = 1;
                continue;
            } else {
                m++;
            }
            
        }
        cout << ret << endl;
    }
}

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

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

int daycount(int year , int month , int day)
{
	int total = 0;
	total += year * 365;		//year??´1???1??\?????§?????\??°
	for (int i = 1; i <= month; i++)
	{
		total += Emonth[i];			//1???1??\???month???1??\?????§?????\??°(???????????´??????????????????)
	}
	
	total += year / 4;
	total -= year / 100;
	total += year / 400;		//???????????´????????°

	if (((year % 4 == 0) && (year % 100 != 0 || year % 400 == 0)) && (month < 3))
	{
		total--;		//???????????´??????2???29??\??????????????????????????§?????????????????????
	}

	total += day;		//1??\???day??\?????§?????\??°

	return total;
}


int main()
{
	int y1, y2, m1, m2, d1, d2;
	while (1)
	{
		int total1 = 0, total2 = 0;
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if (y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2< 0) break;

		total1 = daycount(y1, m1, d1);
		total2 = daycount(y2, m2, d2);

		cout << total2 - total1 << endl;

	}


	return 0;
}

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

bool uru(int y){
  if(!(y%400))return true;
  if(!(y%100))return false;
  if(!(y%4))return true;
  return false;
}

int day(int y, int m, int d){
  int res = 0;
  int month[] = {31,0,31,30,31,30,31,31,30,31,30};

  for(int i=0;i<y;i++){
    if(uru(i))res += 366;
    else res += 365;
  }

  for(int i=0;i<m-1;i++)res += month[i];
  if(m>2){
    if(uru(y))res += 29;
    else res += 28;
  }

  res += d;
  return res;
}

  

int main(){
  int y1,y2,m1,m2,d1,d2;

  while(1){
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if(y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0)break;

    int s1,s2;
    s1 = day(y1,m1,d1);
    s2 = day(y2,m2,d2);
    cout << s2 - s1 << endl;
  }
}

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;

int main()
{
	int y1, m1, d1, y2, m2, d2;
	const int md[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30 ,31, 30, 31 };

	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;

	while (y1 >= 0 && m1 >= 0 && d1 >= 0 && y2 >= 0 && m2 >= 0 && d2 >= 0) {
		int d = d2 - d1;

		if(m1 <= m2) {
			d += 365 * (y2 - y1);

			for (int i = m1 - 1; i < m2 - 1; i++)
				d += md[i];
		}
		else {
			d += 365 * (y2 - y1 - 1);

			for (int i = m1 - 1; i < 12; i++)
				d += md[i];

			for (int i = 0; i < m2 - 1; i++)
				d += md[i];
		}

		for (int i = y1; i <= y2; i++) {
			if (i % 4 == 0 && i % 400 != 100 && i % 400 != 200 && i % 400 != 300) {
				if (!(i == y1 && m1 > 2) && !(i == y2 && m2 < 3))
					d++;
			}
		}

		cout << d << endl;

		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
	}

	return 0;
}