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<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
class date {
public:
    int year;
    int month;
    int day;
    void in(){cin>>year>>month>>day;}
    bool flag(){if(year<0||month<0||day<0)return false; else return true;}
    
};
int urucalendar[] = {31,29,31,30,31,30,31,31,30,31,30,31};
int calendar[]    = {31,28,31,30,31,30,31,31,30,31,30,31};
int main(){
    date a,b;
    while(1){
        a.in(); b.in();
        if(!(a.flag()&&b.flag()))return 0;
        int cnt=0;
        while(true){
            if(a.year==b.year&&a.month==b.month&&a.day==b.day)break;
            cnt++;a.day++;
            if((a.year%4==0&&(a.year%100!=0))||a.year%400==0){
                if(a.day==urucalendar[a.month-1]+1){
                    a.day=1;
                    a.month++;
                }
                if(a.month==13){
                    a.month=1; a.year++;
                    }
            }else {
                if(a.day==calendar[a.month-1]+1){
                    a.day=1;
                    a.month++;
                }
                if(a.month==13){
                        a.month=1; a.year++;
                }
            }
        }
        cout<<cnt<<endl;
    }
}

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;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int calc(int y1, int y2) {
	int a;
	a = y2/4 - y1/4;
	if(y2%4==0 || y1%4==0) a++;
	a -= y2/100 - y1/100;
	if(y2%100==0 || y1%100==0) a--;
	a += y2/400 - y1/400;
	if(y2%400==0 || y1%400==0) a++;
	return a;
}
bool uruu(int y) {
	return y%4 == 0 && y%100 != 0 || y%400 == 0;  
}
int main() {
	int y1, m1, d1, y2, m2, d2;
	while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 && (y1>=0 && m1>0 && d1>0 && y2>=0 && m2>0 && d2>0)) {
		int uy = calc(y1,y2);
		int ret = (y2-y1+1)*365+uy;
		int day = 0;
		rep(i,m1-1) day += d[i];
		for(int i=11; i>=m2; --i) day += d[i];
		day += d1-1, day += d[m2-1]-d2+1;
		if(uruu(y1) && m1>2) day++;
		if(uruu(y2) && m2<=2) day++;
		cout << ret - day << endl;
	}
	return 0;
}

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

int y[2],m[2],d[2];

ll calc(int,int,int);

int main(){
  ll a,b;

  while(cin>>y[0]>>m[0]>>d[0]>>y[1]>>m[1]>>d[1]){
    if(y[0]<0||m[0]<0||d[0]<0||y[1]<0||m[1]<0||d[1]<0)break;
    a=calc(y[0],m[0],d[0]);
    b=calc(y[1],m[1],d[1]);
    cout<<b-a<<endl;
  }

}

ll calc(int y,int m,int d){
  int t[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

  //365+365+365+366==1461   4year
  //1461*25-1==36524      100year
  //36524*4+1==146097     400year
  if(y%4==0&&(y%100!=0||y%400==0)){
    t[2]=29;
  }
  y+=3;
  ll res=0;
  res+=146097*(y/400);y%=400;
  res+=36524*(y/100);y%=100;
  res+=1461*(y/4);y%=4;
  res+=365*y;
  
  int cnt=0;
  
  for(int i=1;i<=m;i++){
    for(int j=1;j<=(i==m?d:t[i]);j++){
      cnt++;
    }
  }
  
  return res+cnt;
}

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

#define pb push_back
#define fr first
#define sc second
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> pip; 
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int 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 total1=0,total2=0;
    for(int i=0;i<y1;i++){
      if(i%4==0 && (i%100!=0 || i%400==0)){
	total1+=366;
	 
      }else {
	total1+=365;
      }
    }

    for(int i=0;i<y2;i++){
      if(i%4==0 && (i%100!=0 || i%400==0)){
	total2+=366;
	  
      }else {
	total2+=365;
      }
    }

    for(int i=1;i<m1;i++){
      if(i==2){
	if(y1%4==0 || i%100!=0 || i%400==0){
	  total1+=29;
	  
	}
	else total1+=28;
      }
      else if(i==4 || i==6 || i==9 || i==11){
	total1+=30;
      }
      else total1+=31;
    }
    
    for(int i=1;i<m2;i++){
      if(i==2){
	if(y2%4==0 || i%100!=0 || i%400==0){
	    total2+=29;
	  
	}
	else total2+=28;
      }
      else if(i==4 || i==6 || i==9 || i==11){
	total2+=30;
      }
      else total2+=31;
    }

    total1+=d1;
    total2+=d2;
    cout<< total2-total1<< endl;
  }
}

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

int fairfield(int y, int m, int d) {
	if (m < 3) {
		--y;
		m += 12;
	}
	return 365 * y + (y / 4) - (y / 100) + (y / 400) + (306 * (m + 1) / 10) + d - 428;
}

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