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;
inline bool check(int year){
    return year%400==0||(year%4==0&&year%100!=0);
}
int cnt(int year){
    int ans=0;
    for(int i=1;i<=year;i++)
        if(check(i))ans++;

    return ans;
}
int main(){
    int d[]={0,31,28,31,30,31,30,31,31,30,31,30};
    for(int i=1;i<12;i++)d[i]+=d[i-1];

    int y1,m1,d1,y2,m2,d2;
    while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
        if(y1==-1||m1==-1||d1==-1)continue;
        if(y2==-1||m2==-1||d2==-1)continue;
        int a1=365*(y1-1)+cnt(m1>2?y1:y1-1)+d[m1-1]+d1;
        int a2=365*(y2-1)+cnt(m2>2?y2:y2-1)+d[m2-1]+d2;
        cout<<a2-a1<<endl;
    }
    return 0;
}

C++: #include<cstdio>
using namespace std;
int func(int,int,int);
int main(void)
{
	int y1,m1,d1,y2,m2,d2;
	int x1,x2;
	while(1)	{
		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;
		x1=func(y1,m1,d1);
		x2=func(y2,m2,d2);
		printf("%d\n",x2-x1);
	}
	return 0;
}
int func(int y,int m,int d)
{
	int i,j,sum;
	int mo[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	sum=0;
	for(i=0;i<y;i++)	{
		sum+=365;
		if(i%400==0 || (i%100!=0 && i%4==0))	sum++;
	}
	for(i=1;i<m;i++)	{
		sum+=mo[i];
		if(i==2)	{
			if(y%400==0 || (y%100!=0 && y%4==0))	sum++;
		}
	}
	sum+=d;
	return sum;
}

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

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

int leap(int y){
  if( !(y%400) ) return 1;
  if( !(y%100) ) return 0;
  if( !(y%4) ) return 1;
  return 0;
}

int solve(int y, int m, int d){

  if(y == y2 && m == m2 && d == d2) return 0;

  if(leap(y) && m == 2 && d == 28) return solve(y,3,1)+2;
  else if(m == 12 && d == 31) return solve(y+1,1,1)+1;
  else if(p[m] == d) return solve(y,m+1,1)+1;
  else return solve(y,m,d+1)+1;

}

int main(){

  int y,m,d;

  while(true){
    cin >> y >> m >> d >> y2 >> m2 >> d2;
    if(y < 0 || m < 0 || d < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;

    cout << solve(y, m, d) << endl;
  }

}

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

int main() {
	int y,m,d,Y,M,D,i,b,c,yday,mday,day;
	int sum,n,uru,nuru;
	for(;;){
		
		if(y==-1||m==-1||d==-1||Y==-1||M==-1||y==-1){
			break;
		}
		
		
	
	cin>>y>>m>>d>>Y>>M>>D;
	
	
	
	
	yday=(Y-y)*365;
	mday=(M-m)*30;
	day=D-d;
	uru=(Y-y)/4;
	if(y%4==0){
		uru=uru+1;
	}
	if(1900<=y&&Y>=2000){
		uru=uru-1;
	}if(2000<=y&&Y>=2100){
		uru=uru-1;
	}if(2100<=y&&Y>=2200){
		uru=uru-1;
	}if(2200<=y&&Y>=2300){
		uru=uru-1;
	}if(2300<=y&&Y>=2400){
		uru=uru-1;
	}if(2400<=y&&Y>=2500){
		uru=uru-1;
	}if(2500<=y&&Y>=2600){
		uru=uru-1;
	}if(2600<=y&&Y>=2700){
		uru=uru-1;
	}if(2800<=y&&Y>=2900){
		uru=uru-1;
	}if(2900<=y&&Y>=3000){
		uru=uru-1;
	}
	
	sum=yday+mday+day+uru;
	
	if(m<=2&&2<=M&&m!=M){
		sum+=1;
	}
	if(m<=4&&4<=M&&m!=M){
		sum+=1;
	}
	if(m<=6&&6<=M&&m!=M){
		sum+=1;
	}
	if(m<=9&&9<=M&&m!=M){
		sum+=1;
	}
	if(m<=12&&12<=M&&m!=M){
		sum+=1;
	}
	
	
	if(Y%400==0&&y%400==0&&Y!=y){
		
		sum=sum+1;
	}
	
	if(sum!=0){
	printf("%d\n",sum);
	}
}
	return 0;
}

C++: #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

int month[]={
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = y*365+d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    if ( i %100 == 0){
      if ( i %400 != 0)continue;
      else if ( i %400 == 0)base++;//,cout << i <<" " << y<<m<<d<<endl;
    }else if ( i%4 == 0 )base++;//,cout << i << " " <<y<<m<<d<<endl;
  }
  return base;
}


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

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

int mc[12]={0,31,59,90,120,151,181,212,243,273,304,334};

long long dat(int y,int m,int d) {
	long long an;
	an=y*365+mc[m-1]+d+y/4-y/100+y/400;
	if (((y % 4==0 && y % 100!=0) || y % 400==0) && m<3) an--; 
	return an;
}

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

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

int main(){
  while(1){
    int day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int uruday[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
    int i,j,y1,m1,d1,y2,m2,d2;
  int total=0;
  cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
  if(y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0)break;
  for(i = y1; i < y2; i++){
    if(i%4==0){
      total += 366;
      if(i%100==0)total-=1;
      if(i%400==0)total+=1;
    }
    else total+=365;
  }
  
  for(i = 1; i < m2; i++){
    if(i==2 && (y2%4==0)){
      total+=uruday[i];
      if(y2%100==0)total-=1;
      if(y2%400==0)total+=1;
    }
    else total+=day[i];
  }

  for(i = 1; i < m1; i++){
  if(i==2 && (y2%4==0)){
      total-=uruday[i];
      if(y2%100==0)total+=1;
      if(y2%400==0)total-=1;
    }
    else total-=day[i];
  }
  
  total+=d2-d1;

  cout << total << endl;
  }
  return 0;
}

C++: /* http://ufcpp.net/study/algorithm/o_days.html */
#include <iostream>
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 a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f , a != -1){
		cout << GetDays(d,e,f) - GetDays(a,b,c) << endl;
	}
}

C++: #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

int month[]={
  0,
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    base+=365;
    if ( i %400 == 0 ||
	 (i % 100 !=0 && i % 4 == 0))base++;
  }
  return base;
}



/*
  correct version
int day(int y,int m,int d){
  y += 4800;
  if (m < 3) --y, m += 12;
  return 365L*y+y/4-y/100+y/400+(153*m-457)/5+d-32045;
}
*/

main(){
  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 a=day(y1,m1,d1),b=day(y2,m2,d2);
    cout << b-a << endl;
  }
}