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) 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 <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] == -1 || m[i] == -1 || d[i] == -1) 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){
	if(i%400 == 0);
	else if(i%100 == 0) continue;
	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 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(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;
	}
}

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

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

int days[] =  { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int sdays[] = { 0, 31, 59, 90,120,151,181,212,243,273,304,334,365};
int FromNewYear(int year, int month, int day) {
	int count = 0;
	count += sdays[month-1];
	if(isLeepYear(year) && month>2) count += 1;
	count += day;
	return count;
}

int DaysInYear(int year) {
	return (isLeepYear(year) ? 366 : 365);
}

int main() {
	int y1, m1, d1, y2, m2, d2, ans;
	while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
		ans = 0;
		if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1 || d2==-1) break;
		for(int y = y1+1; y<y2; ++y) {
			ans += DaysInYear(y);
		}
		if(y1!=y2) {
			ans += DaysInYear(y1)-FromNewYear(y1, m1, d1);
			ans += FromNewYear(y2, m2, d2);
		}else {
			ans += FromNewYear(y2, m2, d2) - FromNewYear(y1, m1, d1);
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

typedef struct{
  int y;
  int m;
  int d;
}Info;
typedef long long ll;

Info in[2];

int toY(int in){
  if(in%4) return 365;
  if(in%400 && in%100 == 0) return 365;
  return 366;
}

int toM(int in,int year){
  if(in == 2){
    if(toY(year) == 366) return 29;
    else return 28;
  }
  if(in == 4 || in == 6 || in == 9 || in == 11) return 30;
  return 31;
}

int toD(Info info){
  ll sum = 0;
  for(int i = 1; i < info.y; i++) sum += toY(i);
  for(int i = 1; i < info.m; i++) sum += toM(i,info.y);
  sum += info.d;
  return sum;
}

int main(){
  while(1){
    cin >> in[0].y >> in[0].m >> in[0].d;
    cin >> in[1].y >> in[1].m >> in[1].d;
    for(int i = 0; i < 2; i++){
      if(in[i].y < 0 || in[i].m < 0 || in[i].d < 0) return 0;
    }
    cout << toD(in[1])-toD(in[0]) << endl;
  }
}