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 <bits/stdc++.h>
using namespace std;

int pm(int y, int m) {
    int sum = 0;
    int s[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for (int i = 0; i < m - 1; i++) {
        sum += s[i];
        if (i == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) sum += 1;
    }
    return sum;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2,
           y1 > -1 && y2 > -1 && m1 > -1 && m2 > -1 && d1 > -1 && d2 > -1) {
        y1--;
        int t1 = y1 * 365 + (y1 / 400) - (y1 / 100) + (y1 / 4);
        y1++;
        t1 += d1;
        t1 += pm(y1, m1);

        y2--;
        int t2 = y2 * 365 + (y2 / 400) - (y2 / 100) + (y2 / 4);
        y2++;
        t2 += d2;
        t2 += pm(y2, m2);

        cout << t2 - t1 << endl;
    }

    return 0;
}

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

int main(){
int sc[14]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int yd=365;
int y1,y2,m1,m2,d1,d2;
bool f=false;
while(1){
	bool FB=false;
cin>>y1>>m1>>d1>>y2>>m2>>d2;
if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0)break;
int by=y1;
int ay=y2;
int dc=0;
if((by%4==0&&by%100!=0)||by%400==0){f=true;sc[2]=29;}

if(by!=ay){
for(int i=m1;i<=12;i++)
dc+=sc[i];
dc-=d1;FB=true;
by++;

for(int i=by;i<ay;i++){
if((i%4==0&&i%100!=0)||by%400==0)dc+=366;
else {dc+=365;}
}
by=ay;
m1=1;d1=1;
}
if((by%4==0&&by%100!=0)||by%400==0){f=true;sc[2]=29;}
else sc[2]=28;
for(int i=m1;i<m2;i++)
dc+=sc[i];

dc+=d2;
if(FB==false)dc-=d1;
cout<<dc<<endl;
}
return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007


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


int main(){
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int b[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int y1,y2,m1,m2,d1,d2;
	ll ans=0;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
		ans=0;
		if(d1==-1&&d2==-1)break;
		if(y1<y2){
			if(is_Leap(y1)){
				ans+=b[m1-1]-d1+1;
				for(int i=m1; i<12; i++){
					ans+=b[i];
				}
			}
			else{
				ans+=a[m1-1]-d1+1;
				for(int i=m1; i<12; i++){
					ans+=a[i];
				}
			}
			m1=1;
			d1=1;
		}
		y1++;
		while(y1<y2){
			if(is_Leap(y1))ans+=366;
			else ans+=365;
			y1++;
		}
		for(int i=m1-1; i<m2-1; i++){
			if(is_Leap(y1))ans+=b[i];
			else ans+=a[i];
			//d1=1;
		}
		ans+=d2-d1;
		cout<<ans<<endl;
	}
}

C++: #include <iostream>

#define month(m, a) \
		for(int i = 1; i <= m; i++)\
		if(i == 2){\
			a += 28;\
		} else if(i == 4 || i == 6 || i == 9 || i == 11){\
			a += 30;\
		} else {\
			a += 31;\
		}\

using namespace std;

int main(int argc, char **argv)
{
	int y1, m1, d1, y2, m2, d2, a1, a2, a3, a4;
	
	while(1){
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if(y1 < 0 || m1 < 0 || d1 < 0 || y1 < 0 || m2 < 0 || d2 < 0){
			break;
		}
		
		a2 = y2 - y1;
		for(a1 = 0; y1 <= y2; y1++){
			if(y1%400 == 0 || (y1%4 == 0 && y1%100 != 0)){
				a1 += 1;
				y1 += 4;
				break;
			}
		}
		for(; y1 <= y2; y1 += 4){
			if(y1%400 == 0 || y1 % 100 != 0){
				a1 += 1;
			}
		}
		a2 -= a1;
		a4 = a3 = 0;
		month(m1, a3);
		month(m2, a4);

		cout << (a2*365 + a1*366 + a4 - a3 + d2 - d1) << endl;
	}
	
	return 0;
}

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

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

int dc(int y,int m,int d) {
    int res = 0;
    for(int i=1; i<y; ++i) res += 365 + isleap(i);
    for(int i=1; i<m; ++i) {
        res += 31;
        if(i == 4 || i == 6 || i == 9 || i == 11) res--;
        if(i == 2) res -= 3 + isleap(y);
    }
    res += d;
    return res;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while(cin>>y1>>m1>>d1>>y2>>m2>>d2) {
        if(y1 == -1 && y2 == -1) break;

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

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

int main() 
{
	while (1) {
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if (a < 0 || b < 0 || c < 0 || d < 0 || e < 0 || f < 0)break;
		int l, r; l = r = 0;
		for (int g = 1; g < a; g++) {
			if (g % 400 == 0) l += 366;
            else	if (g % 100 == 0)l += 365;
            else    if (g % 4 == 0) l += 366;
            else l += 365;
		}
		for (int g = 1; g < b; g++) {
			switch (g) {
			case 1:case 3:case 5:case 7:case 8:case 10:case 12:l += 31; break;
			case 4:case 6:case 9:case 11: l += 30; break;
			case 2:if (a % 400 == 0) l += 29;
				   else	if (a % 100 == 0)l += 28;
				   else    if (a % 4 == 0) l += 29;
				   else l += 28;
			}
		}
		l += c;
		for (int g = 1; g < d; g++) {
			if (g % 400 == 0) r += 366;
			else	if (g % 100 == 0)r += 365;
			else    if (g % 4 == 0) r += 366;
			else r += 365;
		}
		for (int g = 1; g < e; g++) {
			switch (g) {
			case 1:case 3:case 5:case 7:case 8:case 10:case 12:r += 31; break;
			case 4:case 6:case 9:case 11: r += 30; break;
			case 2:if (d % 400 == 0) r += 29;
				   else	if (d% 100 == 0)r += 28;
				   else    if (d % 4 == 0) r+= 29;
				   else r += 28;
			}
		}
		r += f;
		cout << r - l << endl;
	}
}