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>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int days[2][12] = {
  {
      31,
      30,
      31,
      28,
      31,
      30,
      31,
      31,
      30,
      31,
      30,
      31
  },
  {
      31,
      30,
      31,
      29,
      31,
      30,
      31,
      31,
      30,
      31,
      30,
      31
  }
};

int uruu(int y){
  return (y % 4 == 0 && (y % 400 == 0 || y % 100 != 0)) ? 1 : 0;
}

int day(int y, int m, int d){
  int ret = 0;
  REP(i,y) ret += 365 + uruu(i);
  REP(i,m-1) ret += days[uruu(y)][i];
  ret += d;
  return ret;
}

int main(){
  int y1, m1, d1, y2, m2, d2;
  while(scanf("%d%d%d%d%d%d",
	      &y1, &m1, &d1, 
	      &y2, &m2, &d2), y1 != -1){
    int h1 = day(y1,m1,d1);
    int h2 = day(y2,m2,d2);
    print(abs(h1 - h2));
  } 
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int i,year1,year2,month1,month2,day1,day2,someday=0;
    int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

    while(1){
        cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2;
        if(year1 == -1 || year2 == -1 || month1 ==-1 || month2 == -1 || day1 == -1 || day2==-1){
            break;
        }

        someday=0;

        someday += 365 * (year2 - year1);

        int box;
        for(box=year1;box<=year2;box++){
            if(box % 4 == 0){
                if(box % 100 == 0){
                    if(box % 400 == 0){
                        someday++;
                    }
                }
                else {
                    someday++;
                }
            }
        }

        if(year2 > year1 && month2 < month1){
            if(year1 % 4 == 0 || year2 % 4 == 0){
                if(year1 % 100 == 0 || year2 % 100 == 0){
                    if(year1 % 400 == 0 || year2 % 400 == 0){
                        someday -= 366;
                    }
                    else {
                        someday -= 365;
                    }
                }
                else {
                    someday -= 366;
                }
            }
            else{
                someday -= 365;
            }
            
        }
        
        if(month1 == month2){
            someday += day2 - day1;  
        }
        else if(month1 < month2){
            for(i=1;i<month2 - month1;i++){
                someday += month[month1 + i];
            }
            someday += month[month1] - day1 + day2;
        }
        else {
            for(i=1;i<month2 - month1 + 12;i++){
                if(month1 + i > 12){
                    someday += month[month1 + i -12];
                }
                else {
                    someday += month[month1 + i];
                }
            }
             someday += month[month1] - day1 + day2;
        }

        cout << someday << endl;
        
    }

    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)

int f(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;
    int y2, m2, d2;
    while(1) {
        cin >> y1 >> m1 >> d1;
        cin >> y2 >> m2 >> d2;
        if(y1==-1) break;
        cout << f(y2, m2, d2) - f(y1, m1, d1) << endl;
    }
}

C++: #include <iostream>

using namespace std;

bool is_uruu(int y)
{
	return y % 400 == 0 || (y % 4 == 0 && y % 100 != 0);
}

int daymonth(int y, int m)
{
	if (m == 2)
	{
		return is_uruu(y) ? 29 : 28;
	}
	
	if (m == 4 || m == 6 || m == 9 || m == 11)
	{
		return 30;
	}

	return 31;
}

int daycount(int y, int m, int d)
{
	int ret = 0;

	for (int i = 1; i < y; i++)
	{
		ret += is_uruu(i) ? 366 : 365;
	}

	for (int i = 1; i < m; i++)
	{
		ret += daymonth(y, i);
	}

	ret += d;

	return ret;
}

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 || y2 < 0 || m2 < 0 || d2 < 0)
		{
			break;
		}

		cout << daycount(y2, m2, d2) - daycount(y1, m1, d1);
	}

	return 0;
}

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