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 <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[0] <=2) continue;
	ans++;
      }
    }

    cout << ans << endl;

  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int day[] = { 0, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31 };
    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 ans = 0;
        bool success = false;
        for (int i = y1, j = m1, k = d1; i <= y2; i++) {
            for (j; j <= 12; j++) {
                for (k; k <= day[j]; k++) {
                    if (i == y2 && j == m2 && k == d2) {
                        success = true;
                        break;
                    }
                    ans++;
                }
                if (success == true) {
                    break;
                }
                k = 1;
            }
            if (success == true) {
                break;
            }
            j = 1;
            if (i % 100 == 0) {
                if (i % 400 == 0) {
                    ans++;
                }
            }
            else if (i % 4 == 0) {
                ans++;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
//#include <utility>
#include <set>
#include <iostream>
//#include <memory>
#include <string>
#include <vector>
#include <algorithm>
//#include <functional>
#include <sstream>
//#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cctype>
#include <cstring>
//#include <ctime>
#include <iterator>
#include <bitset>
//#include <numeric>
//#include <list>
//#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;
int mo[12]={31,28,31,30,31,30,31,31,30,31,30,31};
bool is_leap(int a){
	if(a%400==0) return true;
	if(a%100==0) return false;
	if(a%4==0) return true;
	return false;
}
int foo(int y,int m,int d){
	bool f=is_leap(y);
	int ret=0;
	while(m<=12){
		if(m==2&&f){
			ret+=mo[m-1]-d+2;
		}
		else{
			ret+=mo[m-1]-d+1;
		}
		m++;
		d=1;
	}
	// cout<<"ret "<<ret<<endl;
	return ret;
}


void mainmain(){
	vint a(6);
	while(1){
		rep(i,6){
			cin>>a[i];
			if(a[i]==-1) return;
		}
		int ans=0;
		if(a[0]==a[3]){
			cout<<-foo(a[3],a[4],a[5])+foo(a[0],a[1],a[2])<<endl;
			continue;
		}
		rep(i,2) ans+=foo(a[0+i*3],a[1+i*3],a[2+i*3]);
		ans-=365;
		if(is_leap(a[3])&&(a[4]==1||a[4]==2)) ans--;
		a[0]++;
		while(a[0]!=a[3]){
			 if(is_leap(a[0])) ans++;
			 ans+=365;
			 a[0]++;
		}
		cout<<ans<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

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

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

bool leap(int y){

  if(y%400 == 0) return true;
  if(y%100 == 0) return false;
  if(y%4 == 0) return true;
  return false;
}

int solve(int y1, int m1, int d1, int y2, int m2, int d2){

  if(y1 == y2 && m1 == m2 && d1 == d2) return 0;

  if(leap(y1) && m1 == 2 && d1 == 28) return solve(y1,3,1,y2,m2,d2)+2;
  else if(m1 == 12 && d1 == 31) return solve(y1+1,1,1,y2,m2,d2)+1;
  else if(p[m1] == d1) return solve(y1,m1+1,1,y2,m2,d2)+1;
  else return solve(y1,m1,d1+1,y2,m2,d2)+1;

}

int main(){

  int y1,m1,d1,y2,m2,d2;

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

    cout << solve(y1, m1, d1, y2, m2, d2) << endl;
  }

}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <complex>
#include <sstream>
#include <stack>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};
int main()
{
	reep(i, 1, 12){
		days[i] += days[i-1];
	}
	
	for(;;){
		int e[2];
		rep(i, 2){
			int y, m, d;
			scanf("%d%d%d", &y, &m, &d);
			if(y<0)
				return 0;
			
			e[i] = days[m-1] + d - 1;
			if(y%4==0 && (y%100!=0 || y%400==0) && m>=3)
				++e[i];
			--y;
			e[i] += y*365 + y/4 - y/100 + y/400;
		}
		
		printf("%d\n", e[1] - e[0]);
	}
	
	return 0;
}

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

int fairfield(int y,int m,int d)
{
  if(m<3)
    {
      y--;
      m+=12;
    }
  return 365*y+(y/4)-(y/100)+(y/400)+(306*(m+1)/10)+d-428;
}

int main()
{
  int y1,m1,d1,y2,m2,d2;
  for(;cin>>y1>>m1>>d1>>y2>>m2>>d2,y1!=-1;)
    {
      cout<<fairfield(y2,m2,d2)-fairfield(y1,m1,d1)<<endl;
    }
}