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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

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

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

int main() {
  int y1, m1, d1, y2, m2, d2;
  while (scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)) {
    if (y1 == -1) break;
    int lhs = d1, rhs = d2;
    for (int i = 1; i < y1; ++i) {
      lhs += 365;
      if (IsLeap(i)) ++lhs;
    }
    for (int i = 1; i < y2; ++i) {
      rhs += 365;
      if (IsLeap(i)) ++rhs;
    }
    for (int i = 1; i < m1; ++i)
      lhs += days[i];
    for (int i = 1; i < m2; ++i)
      rhs += days[i];
    if (m1 >= 3 && IsLeap(y1)) ++lhs;
    if (m2 >= 3 && IsLeap(y2)) ++rhs;
    // printf("%d : %d\n", lhs, rhs);
    printf("%d\n", rhs - lhs);
  }
  return 0;
}

C++: #include<iostream>

using namespace std;

const int day[13]={0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int Uday[13]={0,31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int y,m,d,ty,tm,td;
long long int ans=0;
bool uru=false;

void uruu(int year){
	uru=false;
	if(year%4==0)uru=true;
	if(year%100==0)uru=false;
	if(year%400==0)uru=true;
}


int main(void){
	while(1){
		scanf("%d%d%d%d%d%d",&y,&m,&d,&ty,&tm,&td);
		if(y==-1 && m==-1 && d==-1 && ty==-1 && tm==-1 && td==-1)break;
		ans=0;
		uruu(y);
		while(1){
			if(y==ty && m==tm && d==td)break;
			else{
				ans++;
				if(uru){
					if(d==Uday[m]){
						m++;
						d=1;
						if(m==13){
							y++,uruu(y),m=1;
						}
					}else{
						d++;
					}
				}else{
					if(d==day[m]){
						m++;
						d=1;
						if(m==13){
							y++,uruu(y),m=1;
						}
					}else{
						d++;
					}
				}
			}
		}
		printf("%d\n",ans);
	}
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int dm[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 cnv(int y,int m,int d){
    bool uru[4000]={0};
    for(int i=1;i<4000;i++){
        if(i%4==0)uru[i]=true;
        if(i%100==0)uru[i]=false;
        if(i%400==0)uru[i]=true;
    }
    int D=0;
    for(int i=1;i<y;i++)
        D+=(uru[i])?366:365;

    for(int i=0;i<m;i++)
        D+=dm[uru[y]][i];
    D+=d;
    return D;
}
int main(){
   int y1,m1,d1,y2,m2,d2;
   while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
        if(y1==-1)return 0;
        cout<<cnv(y2,m2,d2)-cnv(y1,m1,d1)<<endl;
   }
}

C++: #include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
using namespace std;
int leapyear(int year){
  return (year%4!=0||(year%100==0&&year%400!=0) ?0:1);
}
int main(){
int y1,m1,d1,y2,m2,d2;
while(cin>>y1>>m1>>d1>>y2>>m2>>d2,y1>0&&y2>0&&m1>0&&m2>0&&d1>0&&d2>0){
long long int sum=-d1;
while(1){
if(y1==y2&&m1==m2){sum+=d2;break;}
if(y1<=y2){
    switch(m1){
    case  1:
    case  3:
    case  5:
    case  7:
    case  8:
    case 10:
    case 12:sum+=31;break;
    case  4:
    case  6:
    case  9:
    case 11:sum+=30;break;
    case  2:sum+=28+leapyear(y1);break;
    }
	m1++;
	if(m1>12){y1++;m1=1;}
}
}
cout<<sum<<endl;
}
}