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<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(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;
	}
	
	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 <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 if(i == 2) ans -= 2;
      }
    }
    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++;
	else if(i%12 == 2) ans -= 2;
      }
    }


    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[1] <=2) continue;
	else ans++;
      }
    }

    if(ans == 0) ans = 1;
    cout << ans << 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(true){
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;

    if(y1 == -1 && m1 == -1 && d1 == -1 && 
       y2 == -1 && m2 == -1 && d2 == -1) break;

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

  return 0;
}

C++: #include<iostream>
using namespace std;
int w[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int main(){
	int y,r,m,d;
	while(true){
	cin>>y>>m>>d;
	bool t=true,u=false;
	if(y<0||m<0||d<0)
		t=false;
	if(y%4==0){
		u=true;
		if(y%100==0)
			u=false;
		if(y%400==0)
			u=true;
	}
	int ans=-d;
	for(int i=0;i<m-1;i++){
		ans-=w[i];
		if(u==true&&i==1)
			ans--;
	}
	cin>>r>>m>>d;
	if(r<0||m<0||d<0)
		t=false;
	if(t==false)
		break;
    u=false;
	if(r%4==0){
		u=true;
		if(r%100==0)
			u=false;
		if(r%400==0)
			u=true;
	}
	ans+=d;
	for(int i=0;i<m-1;i++){
		ans+=w[i];
		if(u==true&&i==1)
			ans++;
	}
	for(int i=y;i<r;i++){
		u=false;
	    if(i%4==0)
		    u=true;
		if(i%100==0)
		    u=false;
		if(i%400==0)
		    u=true;
		ans+=365;
		if(u==true)
			ans++;
	}
	cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;int day(int y,int m,int d){
    int i,i2,ans=0;
    for(i=1;i<y;i++){
        if(i%4==0&&(i%100!=0||i%400==0))ans+=366;
        else ans+=365;
    }
    for(i=1;i<m;i++){
        if(i==4||i==6||i==9||i==11)ans+=30;
        else if(i==2){
            if(y%4==0&&(y%100!=0||y%400==0))ans+=29;
            else ans+=28;
        }
        else ans+=31;
    }
    ans+=d;
    return ans;
}
int main(void){
    int y1,y2,m1,m2,d1,d2;
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    while(y1!=-1){
        cout<<(day(y1,m1,d1)-day(y2,m2,d2))*-1<<endl;
        cin>>y1>>m1>>d1>>y2>>m2>>d2;
    }
}

C++: #include <iostream>

using namespace std;

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

int day_of_month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int day_count(int y1, int m1, int d1, int y2, int m2, int d2) {
    int day = 0;

    if (y1 == y2) {
        if (m1 == m2) return d2 - d1;
        for (int i = m1 + 1; i <= m2 - 1; i++) {
            day += day_of_month[i];
            if (i == 2 && is_leap(y1)) day++;
        }
        day += day_of_month[m1] - d1;
        day += d2;
    } else {
    
        for (int i = y1 + 1; i <= y2 - 1; i++) {
            day += 365;
            if (is_leap(i)) day++;
        }
    
        for (int i = m1 + 1; i <= 12; i++) {
            day += day_of_month[i];
            if (i == 2 && is_leap(y1)) day++;
        }
        day += day_of_month[m1] - d1;
        if (m1 == 2 && is_leap(y1)) day++;
    
        for (int i = 1; i <= m2 - 1; i++) {
            day += day_of_month[i];
            if (i == 2 && is_leap(y2)) day++;
        }
        day += d2;
    }

    return day;
}

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