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++: /* http://ufcpp.net/study/algorithm/o_days.html */
#include <iostream>
using namespace std;

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 a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f , a != -1){
		cout << GetDays(d,e,f) - GetDays(a,b,c) << endl;
	}
}

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



/*
  correct version
int day(int y,int m,int d){
  y += 4800;
  if (m < 3) --y, m += 12;
  return 365L*y+y/4-y/100+y/400+(153*m-457)/5+d-32045;
}
*/

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 <bits/stdc++.h>

using namespace std;

const int CountOfMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

int calculationDaysOfYear(int y, int m, int d) {
	int cnt = 0;

	for (int i = 1; i < m; i++) {
		cnt += CountOfMonth[i];
	}
	cnt += d;
	if (m > 2) {
		if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {
			cnt++;
		}
	}
	
	return cnt;
}

int main() {
	int y1, m1, d1, y2, m2, d2,cntDays;
	int countDaysOfYear[2];

	while (cin >> y1 >> m1 >> d1 >> y2>> m2 >> d2, y1 > 0) {
		countDaysOfYear[0] = calculationDaysOfYear(y1, m1, d1);
		countDaysOfYear[1] = calculationDaysOfYear(y2, m2, d2);
		cntDays = countDaysOfYear[1] - countDaysOfYear[0];
		//cout << countDaysOfYear[0] << endl << countDaysOfYear[1] << endl;
		
		for (int i = y1; i < y2; i++) {
			cntDays += 365;
			if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
				cntDays++;
			}
		}
		cout << cntDays << endl;
	}

	return 0;
}

C++: #include<iostream>
main(){int a,b,c,d,e,f,g,h[]={0,0,31,59,90,120,151,181,212,243,273,304,334};for(;std::cin>>a>>b>>c>>d>>e>>f,a+1;std::cout<<g<<"\n"){g=f-c+h[e]-h[b]+(d-a)*365;e<3?d--:d;b<3?a--:a;g+=d/4-a/4-d/100+a/100+d/400-a/400;}}

C++: #include <iostream>
using namespace std;int day(int y,int m,int d){
    int i,i2,ans=0;
    for(i=1;i<y;i++){
        if(i%4==0&&(i%100!=0||i%400==0))ans+=366;
        else ans+=365;
    }
    for(i=1;i<m;i++){
        if(i==4||i==6||i==9||i==11)ans+=30;
        else if(i==2){
            if(y%4==0&&(y%100!=0||y%400==0))ans+=29;
            else ans+=28;
        }
        else ans+=31;
    }
    ans+=d;
    return ans;
}
int main(void){
    int y1,y2,m1,m2,d1,d2;
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    cout<<abs(day(y1,m1,d1)-day(y2,m2,d2))<<endl;
}

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 day = 0;

    day += d2-d1;

    if(m2>=m1) {
      for(int i=0;i<m2-m1;i++) { //m2>m1
        day += month[m1+i];
      }
    }
    else {
      for(int i=0;i<m1;i++) {
        day -= month[i];
      }
    }

    for(int i=0;i<y2-y1;i++) { //all input meets y2>=y1.
      if((y1+i) % 4 == 0) {
        if(((y1+i) % 100 == 0) && ((y1+i) % 400 != 0)){
          day += 365;
        }
        else {
          day += 366;
        }
      }
      else {
        day += 365;
      }
    }
    cout << day << endl;
  }
}

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

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

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

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

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

    cout << ans << endl;

  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int y1,m1,d1,y2,m2,d2;
  int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  for(int i=0;i<12;month[i+1]+=month[i],i++);
  while(true){
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    if (y1==-1)break;
    int day=0;
    day+=d2-d1+month[m2-1]-month[m1-1]+(y2-y1)*365;
    if(m2<3)y2--;
    if(m1>2)y1++;
    day+=y2/4-(y1-1)/4-y2/100+(y1-1)/100+y2/400-(y1-1)/400;
    cout<<day<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


bool checkUru(const int y){
	if(y%4==0){
		if(y%100==0){
			if(y%400==0){
				return true;
			}
			else{
				return false;
			}
		}
		else
			return true;
	}
	else
		return false;
}

int main(){

	const int md[]={0,31,28,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&&(y1>=0&&m1>=0&&d1>=0&&y2>=0&&m2>=0&&d2>=0)){
		int sum=0;
		if(y1!=y2){
			for(int y = y1+1; y < y2; y++){
				if(checkUru(y)){
					sum+=366;
				}
				else
					sum+=365;
			}
			// y1ツづ2ツづ可づつつ「ツづ計ツ算
			if(checkUru(y1)){
				sum+=(md[m1]-d1);
				if(m1==2)
					sum++;
				for(int m=m1+1; m<=12; m++){
					if(m==2)
						sum++;
					sum+=md[m];
				}
			}
			else{
				sum+=(md[m1]-d1);
				for(int m=m1+1; m<=12; m++){
					sum+=md[m];
				}
			}
			
			if(checkUru(y2)){
				sum+=(d1);

				for(int m=1; m<m2; m++){
					if(m==2)
						sum++;
					sum+=md[m];
				}
			}
			else{
				sum+=(d1);
				for(int m=1; m<m2; m++){
					sum+=md[m];
				}
			}
		}
		else{
			if(m1!=m2){
				for(int m=m1+1; m < m2; m++){
					if(checkUru(y1)&&m==2){
						sum+=29;
					}
					else
						sum+=md[m];
				}
				// m1ツづ2ツづ可づつつ「ツづ計ツ算
				if(checkUru(y1)&&m1==2){
					sum+=(md[m1]-d1)+1;
				}
				else
					sum+=(md[m1]-d1);

				sum+=d2;
			}
			else{
				sum+=d2-d1;
			}
		}
		cout<<sum<<endl;
	}

	return 0;
}