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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e15+9
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

ll table[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 } };

ll solve(ll y, ll m, ll d){
	ll res = 0, year = y;
	y--;
	res += (y / 400) * 146097;
	y %= 400;
	res += (y / 100) * 36524;
	y %= 100;
	res += (y / 4) * 1461;
	y %= 4;
	res += y * 365;
	if (year % 4 == 0){
		if (year % 400 != 0 && year % 100 == 0){
			REP(i, m - 1)res += table[0][i];
		}
		else{
			REP(i, m - 1)res += table[1][i];
		}
	}
	else{
		REP(i, m - 1)res += table[0][i];
	}
	res += d;
	return res;
}

int main(){
	ll a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f){
		if (a < 0 || b < 0 || c < 0 || d < 0 || e < 0 || f < 0)break;
		cout << solve(d, e, f) - solve(a, b, c) << endl;
	}
}