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 <sstream>


using namespace std;


int day_per_month[13] ={0,31, 28, 31, 30, 31, 30 ,31, 31, 30, 31, 30, 31};
int day_per_month_leap_year[13] ={0,31, 29, 31, 30, 31, 30 ,31, 31, 30, 31, 30, 31};

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 y,m;
        y=y1;
        int day = 0;

        
        while(1){
            if(y+1>y2)break;
            
            day+=365;
            if(y%4==0){
                day++;
                if(y%100==0){
                    day--;
                    if(y%400==0){
                        day++;
                    }
                }
            }
            y++;
            
        }
        
        if(m1<m2){
            m=m1;
            while(1){
                if(m+1>m2)break;
                double flag=false;
                if(y2%4==0){
                    flag=true;
                    if(y2%100==0){
                        flag=false;
                        if(y2%400){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    day+=day_per_month_leap_year[m];
                    m++;
                }else{
                    day+=day_per_month[m];
                    m++;
                }
            }
        }else if(m1>m2){
            m=m2;
            while(1){
                if(m-1<m1)break;
                double flag=false;
                if(y2%4==0){
                    flag=true;
                    if(y2%100==0){
                        flag=false;
                        if(y2%400){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    day-=day_per_month_leap_year[m];
                    m++;
                }else{
                    day-=day_per_month[m];
                    m++;
                }
            }
        }
        
        day+=d2-d1;
        
        cout<<day<<endl;
        
        
        
    }
}

C++: #include<iostream>
using namespace std;
int x[5000000], day[13][32], day2[13][32], cnt, a, b, c, d, e, f, daya1, daya2;
int days[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int days2[13] = { 0,31,29,31,30,31,30,31,31,30,31,30,31 };
int main() {
	for (int i = 1; i < 5000000; i++) {
		if ((i % 4 == 0 && i % 100>0) || i % 400 == 0) {
			x[i] = x[i - 1] + 366;
		}
		else {
			x[i] = x[i - 1] + 365;
		}
	}
	for (int i = 1; i <= 12; i++) {
		for (int j = 1; j <= days[i]; j++) {
			day[i][j] = cnt;
			cnt++;
		}
	}
	cnt = 0;
	for (int i = 1; i <= 12; i++) {
		for (int j = 1; j <= days2[i]; j++) {
			day2[i][j] = cnt;
			cnt++;
		}
	}
	while (true) {
		cin >> a >> b >> c >> d >> e >> f;
		if (a < 0) { break; }
		if (b < 0) { break; }
		if (c < 0) { break; }
		if (d < 0) { break; }
		if (e < 0) { break; }
		if (f < 0) { break; }
		daya1 = 0; daya2 = 0;
		daya1 += x[a - 1];
		daya2 += x[d - 1];
		if ((a % 4 == 0 && a % 100>0) || a % 400 == 0) {
			daya1 += day2[b][c];
		}
		else {
			daya1 += day[b][c];
		}
		if ((d % 4 == 0 && d % 100>0) || d % 400 == 0) {
			daya2 += day2[e][f];
		}
		else {
			daya2 += day[e][f];
		}
		cout << daya2 - daya1 << endl;
	}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

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

int main()
{
	int days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

//	cut here before submit 
//	freopen ("testcase.daycount2", "r", stdin );

	string str = "";

	while (getline (cin, str ) ){

		int y1, m1, d1, y2, m2, d2;
		stringstream ss(str);
		ss >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;

		if (y1 == -1 || m1 == -1 || d1 == -1 || y2 == -1 || m2 == -1 || d2 == -1){
			break;
		} // end if
		int res = 0;

		// [úðÇÁ
		for (int year = y1; year <= y2; ++year ){
			if (isleap (year) ){
				++res;
			} // end if
		} // end for
		
		// JnNª[NÅJnª[úðÜÜÈ¢ê
		if (isleap (y1) && m1 >= 3){
			--res;
		} // end if
		// I¹Nª[NÅI¹úª[úðÜÜÈ¢ê
		if (isleap (y2) && m2 <= 2 && d2 <= 29 ){
			--res;
		} // end if
		
		int curr_year = y1;
		int curr_month = m1;
		int curr_day = d1;

		while (curr_year != y2 ){
			while (curr_month != 0 ){
				res += days[curr_month] - curr_day + 1;
				curr_month = (curr_month + 1) % 13;
				curr_day = 1;
			} // end 
			++curr_month;
			++curr_year;
		} // end while

		if (curr_year == y2 ){
			while (curr_month != m2 ){
				res += days[curr_month] - curr_day + 1;
				// _ ++curr_month
				// curr_month = 13 ÆÈÁÄµÜ¤
				// 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 Æµ½¢
				// (curr_month + 1) % 13
				curr_month = ( (curr_month + 1) % 13 == 0 ? 1 : ++curr_month) ;
				curr_day = 1;
 			}// end while
			res += (d2 - curr_day);
		} // end if
		cout << res << endl;
	} // end loop
		
	return 0;
}

C++: #include <cstdio>

using namespace std;

int main(void) {
    while (1) {
        int y1, m1, d1, y2, m2, d2;
        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;
        }
        int d = 0;
        while (y1 != y2 || m1 != m2 || d1 != d2) {
            d++;
            d1++;
            /* 2 4 6 9 11 */
            /* 1 3 5 7 8 10 12 */
            // printf("%4d %2d %2d\n", y1, m1, d1);
            if (((m1 == 4 || m1 == 6 || m1 == 9 || m1 == 11) && d1 > 30) ||
                ((m1 == 1 || m1 == 3 || m1 == 5 ||m1 == 7 || m1 == 8 || m1 == 10 || m1 == 12) && d1 > 31)) {
                d1 = 1;
                m1++;
            } else if (m1 == 2) {
                if (y1 % 4 == 0 && y1 % 100 != 0 || y1 % 400 == 0) {
                    if (d1 > 29) {
                        d1 = 1;
                        m1++;
                    }
                } else if (d1 > 28) {
                    d1 = 1;
                    m1++;
                }
            }
            if (m1 > 12) {
                m1 = 1;
                y1++;
            }
        }
        printf("%d\n", d);
    }
    return 0;
}