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<iostream>
using namespace std;
typedef long long ll;

const int MNUM[] = {12,12};
const int ML[][12] = { {31,28,31,30,31,30,31,31,30,31,30,31},      //day/month in usual year
		      {31,29,31,30,31,30,31,31,30,31,30,31} };  //day/month in leap year
const string DAY[] = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};

struct date{
  int y,m,d;

  date(void):y(0),m(1),d(1){}
  date(int a,int b,int c):y(a),m(b),d(c){}

  int Leap(void){
    if(y%400==0)return 1;
    if(y%100==0)return 0;
    if(y%4==0)return 1;
    return 0;
  }

  date next(void){
    int l = Leap();
    if(ML[l][m-1]<++d){ d=1; m++; }
    if(MNUM[l]<m){ m=1; y++; }
    return *this;
  }

  ll dayCount(void)const{
    date tmp;
    for(ll res=0;;res++){
      if(tmp==*this)return res;
      tmp.next();
    }
  }

  //calculate days from Julian Day(-4713/01/01) using Fliegel's formula.
  ll Fliegel(void){
    int a = (14-m)/12, Y = y+4800-a, M = m+12*a-3;
    return (ll)d + (153*M+2)/5 + 365*Y + Y/4 - Y/100 + Y/400 - 32045;
  }

  //calculate day of week using Zeller congruence.
  int Zeller(void){
    int Y = y, M = m;
    if(M<3){Y--; M+=12;}
    return (Y + Y/4 - Y/100 + Y/400 + (13*M+8)/5 + d)%7;
  }

  bool operator==(const date x)const{return (y==x.y && m==x.m && d==x.d);}
  
  bool operator<(const date x)const{
    if(y!=x.y)return y<x.y;
    if(m!=x.m)return m<x.m;
    return d<x.d;
  }
  
  bool operator<=(const date x)const{return (*this<x || *this==x); }
  bool operator>(const date x)const{return !(*this<=x);}
  bool operator>=(const date x)const{return !(*this<x);}
  
  ll operator-(const date x)const{
    return dayCount() - x.dayCount();
  }
};

int main(){
  int y1,m1,d1,y2,m2,d2;
  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2,y1>=0){
    cout << date(y2,m2,d2)-date(y1,m1,d1) << endl;
  }
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

int main() {
    int y1, m1, d1, y2, m2, d2;
    while ( cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 && y1 != -1 ) {
        int res = 0;
        const int days[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        for ( int y = y1; y <= y2; ++ y ) {
            int ms = 1;
            int me = 12;
            if ( y == y1 ) ms = m1;
            if ( y == y2 ) me = m2;
            for ( int m = ms; m <= me; ++ m ) {
                int ds = 1;
                int de = days[m];
                if ( m == 2 && y % 4 == 0 ) {
                    if ( y % 100 != 0 || y % 400 == 0 ) {
                        de ++;
                    }
                }
                if ( y == y1 && m == m1 ) ds = d1;
                if ( y == y2 && m == m2 ) de = d2;
                for ( int d = ds; d <= de; ++ d ) {
                    // cout << y << "/" << m << "/" << d << endl;
                    res ++;
                }
            }
        }
        cout << res - 1 << endl;
    }
    return 0;
}

C++: 
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

bool isLeap(int i){
	return i % 400 == 0 
			? true : i % 100 == 0
			? false : i % 4 == 0
			? true : false;
}

int getSum(int y,int m,int d,const int* month){
	int sum=0;
	for(int i=0;i<y;i++){
		sum += isLeap(i) ? 366 : 365;
	}

	for(int i=1;i<m;i++){
		sum += i != 2 ? month[i] :
			isLeap(y) ? month[i] + 1 : month[i];
	}

	sum += d;

	return sum;
}

int main(){
	const int month[] = {-1,31,28,31,30,31,30,31,31,30,31,30,31};
	int y1, m1, d1, y2, m2, d2;
	while(~scanf("%d %d %d %d %d %d",&y1, &m1, &d1, &y2, &m2, &d2)){
		if(y1 < 0 || m1 < 0 || d1 < 0
			|| y2 < 0 || m2 < 0 || d2 < 0) break;

		cout << abs(getSum(y1,m1,d1,month) - getSum(y2,m2,d2,month)) << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;

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, m1, d1, y2, m2, d2;
  string s;
  while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
    if (y1 < 0) break; 
    int t1 = getDays(y1, m1, d1);
    int t2 = getDays(y2, m2, d2);
    cout << t2 - t1 << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int Fairfield(int y,int m,int d){
  if(m<=2){y--;m+=12;}
  return 365*y+y/4-y/100+y/400+153*(m+1)/5+d-428;
}

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

C++: #include<iostream>

using namespace std;

int big_small(int y1,int m1,int d1,int y2,int m2,int d2){ /*-1 hidari 1 migi 0 onazi*/
	if(y1>y2) return -1;
	else if(y1<y2) return 1;
	else if(m1>m2) return -1;
	else if(m1<m2) return 1;
	else if(d1>d2) return -1;
	else if(d1<d2) return 1;
	return 0;
}

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

int get_day(int y,int m){
	if(m==1) return 31;
	else if(m==2){
		if(uruu(y)) return 29;
		return 28;
	}
	else if(m==3) return 31;
	else if(m==4) return 30;
	else if(m==5) return 31;
	else if(m==6) return 30;
	else if(m==7) return 31;
	else if(m==8) return 31;
	else if(m==9) return 30;
	else if(m==10) return 31;
	else if(m==11) return 30;
	else if(m==12) return 31;
	return -1;
}

int main(){

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

	while(1){

		cin>>y1>>m1>>d1>>y2>>m2>>d2;

		if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0) break;

		c=0;

		while(1){
			int tmpy=y1+1,tmpm=m1,tmpd=d1;
			if(big_small(tmpy,tmpm,tmpd,y2,m2,d2)==-1) break;
			if(m1>=3){
				if(uruu(y1+1)) c+=366;
				else c+=365;
			}
			else{
				if(uruu(y1)) c+=366;
				else c+=365;
			}
			y1=tmpy,m1=tmpm,d1=tmpd;
		}


		while(1){
			int tmpy=y1,tmpm=m1+1,tmpd=d1;
			if(tmpm==13) tmpy++,tmpm=1;
			if(big_small(tmpy,tmpm,tmpd,y2,m2,d2)==-1) break;
			c+=get_day(y1,m1);
			y1=tmpy,m1=tmpm,d1=tmpd;
		}

		while(1){
			int tmpy=y1,tmpm=m1,tmpd=d1+1;
			if(tmpd>get_day(y1,m1)) tmpm++,tmpd=1;
			if(tmpm==13) tmpy++,tmpm=1;
			if(big_small(tmpy,tmpm,tmpd,y2,m2,d2)==-1) break;
			c++;
			y1=tmpy,m1=tmpm,d1=tmpd;
		}

		cout<<c<<endl;
	}
}