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 <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
 
using namespace std;
 
int num[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
 
bool isLeapYear(int year){
    if(year % 4 != 0)return false;
    else{
        if(year % 100 == 0){
            if(year%400 == 0)return true;
            else{
                return false;
            }
        }else{
            return true;
        }
    }
}
 
int main(){
 
    int year1,month1,day1,year2,month2,day2,sum;
 
    while(true){
        scanf("%d %d %d %d %d %d",&year1,&month1,&day1,&year2,&month2,&day2);
        if(year1 < 0 || month1 < 0 || day1 < 0 || year2 < 0 || month2 < 0 || day2 < 0)break;
 
        sum = 0;
 
        if(year1 == year2 && month1 == month2){
            printf("%d\n",day2-day1);
        }else if(year1 == year2){
 
            if(month1 == 2 && isLeapYear(year1) == true){
                sum += 29 - day1;
            }else{
                sum += num[month1] - day1;
            }
            for(int i=month1+1; i < month2; i++){
                if(i == 2 && isLeapYear(year1) == true){
                    sum += 29;
                }else{
                    sum += num[i];
                }
            }
            sum += day2;
 
            printf("%d\n",sum);
        }else{
 
            if(month1 == 2 && isLeapYear(year1)){
                sum += 29 - day1;
            }else{
                sum += num[month1] - day1;
            }
 
            for(int i = month1 + 1; i <=12; i++){
                if(i == 2 && isLeapYear(year1) == true){
                    sum += 29;
                }else{
                    sum += num[i];
                }
            }
 
            for(int i = year1+1; i < year2; i++){
                if(isLeapYear(i) == true)sum += 366;
                else{
                    sum += 365;
                }
            }
 
            for(int i=1; i < month2; i++){
                if(i == 2 && isLeapYear(year2) == true)sum += 29;
                else{
                    sum += num[i];
                }
            }
 
            sum += day2;
 
            printf("%d\n",sum);
 
        }
 
 
    }
 
    return 0;
}

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

int main(){
	int x=28;
	int W=365;
	int cal[13]={0,31,x,31,30,31,30,31,31,30,31,30,31};
	int cal2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int y1,m1,d1,y2,m2,d2;
	bool F=false;
	while(1){F=false;
		int ans=0;
		cin>>y1>>m1>>d1>>y2>>m2>>d2;if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0)break;
		if(y1!=y2){
			if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;

			if(F==false)cal[2]=28;
			else cal[2]=29;
			ans+=cal[m1]-d1+1;
			//cout<<ans<<endl;
			for(int i=m1+1;i<=12;i++)
			{ans+=cal[i];
		//	cout<<ans<<endl;
			}
			d1=1;m1=1;y1++;
			//cout<<ans<<endl;
		}
		while(y1!=y2){F=false;
				if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;
			if(F==false)W=365;
			else  W=366;
			ans+=W;
			y1++;
			//cout<<ans<<endl;
		}
		while(m1!=m2){F=false;
			if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;

			if(F==false)cal[2]=28;
			else cal[2]=29;

			for(int i=m1;i<m2;i++)
				ans+=cal[i];
			m1=m2;
		}
		ans+=d2-d1;
		cout<<ans<<endl;
	}
	return 0;
}

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

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

    for(int i=1;i<m1;i++){
      if(i==2){
	if(y1%400==0 || ( i%100!=0 || i%4==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%400==0 || ( i%100!=0 && i%4==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 days(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) {
        if (y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0) {
            break;
        }
        cout << days(y2,m2,d2) - days(y1,m1,d1) << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

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

// 0??´1???1??\???????????\??°
long long int day_sum(int y, int m, int d){
	long long int ans;
	ans = 0;
	
	y--;
	
	ans += y * 365;
	ans += (y / 4 - y / 100 + y / 400);
	
	for(int i = 0; i < m - 1; i++){
		ans += days[i];
	}
	ans += d - 1;
	if(((y % 4 == 0) * 2 - 1) * ((y % 10 == 0) * 2 - 1) * ((y % 400 == 0) * 2 - 1) < 0){
		if(m >= 3){
			ans++;
		}
	}
	return ans;
}

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;
		}
		printf("%lld\n", day_sum(y2, m2, d2) - day_sum(y1, m1, d1));
	}
	
	return 0;
}

C++: #include<stdio.h>
int main(void){
	int y1,m1,d1,y2,m2,d2;
	int i;
	int y1day,y2day;
	while(1){
		scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
		y1day=y2day=0;
		if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1  || d2==-1) break;
		y1day=y2day=0;
		for(i=1;i<y1;i++){
			y1day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y1day++;
		}
		for(i=1;i<m1;i++){
			y1day+=31;
			if(i==4 || i==6 || i==9 || i==11) y1day-=1;
			if(i==2){
				y1day-=3;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y1day++;
			}
		}
		y1day+=d1;
		for(i=1;i<y2;i++){
			y2day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y2day++;
		}
		for(i=1;i<m2;i++)	{
			y2day+=31;
			if(i==4 || i==6 || i==9 || i==11) y2day--;
			if(i==2){
				y2day-=3;
				if((y2%4==0 && y2%100!=0) || y2%400==0) y2day++;
			}
	//		printf("y2d==%d\n",y2day);
		}
		y2day+=d2;
	//	printf("%d %d\n",y1day,y2day);
		printf("%d\n",y2day-y1day);
	}
	return 0;
}