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>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#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()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int days[12]={
  31, 30, 31, 24,
  31, 30, 31, 31,
  30, 31, 30, 31
};

bool isUruu(int year){
  return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
}

int allDays(int year){
  return isUruu(year) ? 366 : 365;
}

int remainingDays(int year, int month, int day){
  bool uruu = isUruu(year);
  int ret = days[month - 1] - day + 1;
  if(month == 4 && uruu) ret++;
  month++;
  while(month < 12){
    if(month == 4 && uruu){
      ret += days[month-1] + 1;
    }else{
      ret += days[month-1];
    }
    month++;
  }
  return ret;
}

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;
    int ans = 0;
    if(y1 == y2){
      ans = remainingDays(y1,m1,d1) - remainingDays(y2,m2,d2);
    }else{
      ans += remainingDays(y1,m1,d1);
      for(int y = y1 + 1; y < y2; y++){
        ans += allDays(y);
      }
      ans += allDays(y2) - remainingDays(y2,m2,d2);
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>

using namespace std;

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

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

int main(){

	int year1,month1,day1,year2,month2,day2,sum;

	while(true){
		scanf("%d %d %d %d %d %d",&year1,&month1,&day1,&year2,&month2,&day2);
		if(year1 < 0 || month1 < 0 || day1 < 0 || year2 < 0 || month2 < 0 || day2 < 0)break;

		sum = 0;

		if(year1 == year2 && month1 == month2){
			printf("%d\n",day2-day1);
		}else if(year1 == year2){

			if(month1 == 2 && isLeapYear(year1) == true){
				sum += 29 - day1;
			}else{
				sum += num[month1] - day1;
			}
			for(int i=month1+1; i < month2; i++){
				if(i == 2 && isLeapYear(year1) == true){
					sum += 29;
				}else{
					sum += num[i];
				}
			}
			sum += day2;

			printf("%d\n",sum);
		}else{

			if(month1 == 2 && isLeapYear(year1)){
				sum += 29 - day1;
			}else{
				sum += num[month1] - day1;
			}

			for(int i = month1 + 1; i <=12; i++){
				if(i == 2 && isLeapYear(year1) == true){
					sum += 29;
				}else{
					sum += num[i];
				}
			}

			for(int i = year1+1; i < year2; i++){
				if(isLeapYear(i) == true)sum += 366;
				else{
					sum += 365;
				}
			}

			for(int i=1; i < month2; i++){
				if(i == 2 && isLeapYear(year2) == true)sum += 29;
				else{
					sum += num[i];
				}
			}

			sum += day2;

			printf("%d\n",sum);

		}


	}

    return 0;
}

C++: #include <iostream>

using namespace std;

typedef long long int lli;

int mth1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int mth2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool check(int t)
{
	bool f = false;
	if(t%4 == 0){
		if(t%100 == 0){
			if(t%400 == 0){
				f = true;
			}
		} else {
			f = true;
		}
	}
	
	return f;
}

lli func(int y1, int m1, int d1, int y2, int m2, int d2)
{
	lli r = 0;
	int t;
	
	for(int i = y1+1; i < y2; i++){
		r += (check(i)? 366 : 365);
	}
	if(check(y1)){
		t = 366;
		for(int i = 1; i < m1; i++){
			t -= mth2[i];
		}
	} else {
		t = 365;
		for(int i = 1; i < m1; i++){
			t -= mth1[i];
		}
	}
	t -= d1;
	r += t;
	t = 0;
	if(check(y2)){
		for(int i = 1; i < m2; i++){
			t += mth2[i];
		}
	} else {
		for(int i = 1; i < m2; i++){
			t += mth1[i];
		}
	}
	t += d2;
	r += t;
	if(y1 == y2){
		r -= (check(y1)? 366 : 365);
	}
	
	return r;
}

int main()
{
	int y1, y2, d1, d2, m1, m2;
	
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2 && y1 != -1){
		cout << func(y1, m1, d1, y2, m2, d2) << endl;
	}
	
	return 0;
}

C++: #include<stdio.h>
int m[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int main(){
	int a,b,c,d,e,f;
	while(1){
		scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
		if(a<0||b<0||c<0||d<0||e<0||f<0)break;
		a--;
		d--;
		int one=a*365+a/4-a/100+a/400;
		int two=d*365+d/4-d/100+d/400;
		a++;
		d++;
		for(int i=0;i<b-1;i++)one+=m[i];
		for(int i=0;i<e-1;i++)two+=m[i];
		one+=c;
		two+=f;
		if(b>2&&(a%4==0&&((a%100==0&&a%400==0)||a%100)))one++;
		if(e>2&&(d%4==0&&((d%100==0&&d%400==0)||d%100)))two++;
		printf("%d\n",two-one);
	}
}

C++: #include<iostream>
#include<list>
#include<string>
#include<map>
#include<vector>
using namespace std;
bool step(int y2) {
	if ((y2) % 4 == 0) {
		if ((y2) % 100 == 0) {
			if ((y2) % 400 == 0)
				return true;
			else
				return false;
		}
		else
			return true;
	}
	else
		return false;
}
int main(){
	int y1, m1, d1, y2, m2, d2;
	int m[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
	while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 && y1>=0) {
		int y3 = y2, d3 = d2;
		while (y2 != y1) {
			y2--;
			if (step(y2)&&y2!=y1)
				d2 += 366;
			else
				d2 += 365;	
		}
		if (step(y3) && m2 >= 2)
			d2++;
		while (m2 < m1) {
			m2++;
			if (m2 == 2 && step(y1)) 
				d2--;
			d2 -= m[m2-1];
		}
		while (m2 > m1) {
			m2--;
			if (m2 == 2 && step(y1))
				d2++;
			d2 += m[m2 - 1];
		}
		d2 -= d1;
		cout <<d2<< endl;
	}
	int lk;
	cin >> lk >> lk;
}

C++: #include <iostream>

#define month(m, a) \
		for(int i = 1; i <= m; i++)\
		if(i == 2){\
			a += 28;\
		} else if(i == 4 || i == 6 || i == 9 || i == 11){\
			a += 30;\
		} else {\
			a += 31;\
		}\

using namespace std;

int main(int argc, char **argv)
{
	int y1, m1, d1, y2, m2, d2, a1, a2, a3, a4;
	
	while(1){
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if(y1 == -1){
			break;
		}
		
		a2 = y2 - y1;
		for(a1 = 0; y1 <= y2; y1++){
			if(y1%400 == 0 || (y1%4 == 0 && y1%100 != 0)){
				a1 += 1;
				y1 += 4;
				break;
			}
		}
		for(; y1 <= y2; y1 += 4){
			if(y1%400 == 0 || y1 % 100 != 0){
				a1 += 1;
			}
		}
		a2 -= a1;
		a4 = a3 = 0;
		month(m1, a3);
		month(m2, a4);

		cout << (a2*365 + a1*366 + a4 - a3 + d2 - d1) << endl;
	}
	
	return 0;
}