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<stdio.h>
int main(void)
{
	int y1,m1,d1,y2,m2,d2;
	while(scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2),y1>0)
	{
		int begin=y1+(m1>2), end=y2+(m2>2),c=0,i;
		for(i=begin;i<=end;++i)
			if(i%400==0 || i%100&&i%4==0)
				c++;
		int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(i=1;i<m1;++i) d1+=a[i];
		for(i=1;i<m2;++i) d2+=a[i];
		printf("%d\n",(y2-y1)*365+(d2-d1)+c);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <strstream>
#include<vector>
#include<map>
#include<cmath>
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 y1,y2,m1,m2,d1,d2;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2)
	{
		if(y1==-1)break;
		cout<< GetDays(y2,m2,d2) -  GetDays(y1,m1,d1)<<endl;
	}
	return 0;
}

C++: #include <cstdio>

int main(void)
{
    while (1){
        int y1, y2, m1, m2, d1, d2;
        scanf("%d %d %d %d %d %d", &y1, &m1, &d1, &y2, &m2, &d2);
        if (y1 < 0){
            break;
        }
        
        // ツツツェツδ可ーツづ個古カツ篠ョツ？ツづつゥツつ「ツつ、ツづ個使ツつ、ツづヲ
        if (m1 < 3){
            y1--;
            m1 += 12;
        }
        if (m2 < 3){
            y2--;
            m2 += 12;
        }
        
        int day1 = (y1 * 365) + (y1 / 4) - (y1 / 100) + (y1 / 400) + (m1 * 28) + (((m1 + 1) * 26) / 10) + d1 - 400;
        int day2 = (y2 * 365) + (y2 / 4) - (y2 / 100) + (y2 / 400) + (m2 * 28) + (((m2 + 1) * 26) / 10) + d2 - 400;
        int ans = day2 - day1;
        
        printf("%d\n", ans);
    }
}

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

}