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>
using namespace std;

int days[2][12] = {
	{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334},
	{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}
};

int isLeapYear(int y){
	if(y % 400 == 0) return 1;
	if(y % 100 == 0) return 0;
	if(y % 4 == 0) return 1;
	return 0;
}

int main(){
	int y1, m1, d1, y2, m2, d2;
	
	while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2, y1 >= 0){
		int sum = 0;
		
		for(int i = y1; i < y2; ++i){
			sum += (isLeapYear(i) ? 366 : 365);
		}
		
		sum += days[isLeapYear(y2)][m2-1] + d2;
		sum -= days[isLeapYear(y1)][m1-1] + d1;	
		
		cout << sum << 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;
		}
		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>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int y2, m2, d2;
int solve(int y1, int m1, int d1) {
	int r = 0;
	if (y1 == y2 && m1 == m2 && d1 == d2)return 0;
	if (y1 != y2 && m1 == 1 && d1 == 1) {
		r = 365;
		if (y1 % 4 == 0)r++;
		if (y1 % 100 == 0)r--;
		if (y1 % 400 == 0)r++;
		return r + solve(y1 + 1, m1, d1);
	}
	if (m1 == 12 && d1 == 31)return 1 + solve(y1 + 1, 1, 1);
	else {
		if (m1 == 2) {
			r = 28;
			if (y1 % 4 == 0)r++;
			if (y1 % 100 == 0)r--;
			if (y1 % 400 == 0)r++;
			if (d1 == r)return 1 + solve(y1, m1 + 1, 1);
			else return 1 + solve(y1, m1, d1 + 1);
		}
		else if (m1 == 4 || m1 == 6 || m1 == 9 || m1 == 11) {
			if (d1 == 30)return 1 + solve(y1, m1 + 1, 1);
			else return 1 + solve(y1, m1, d1 + 1);
		}
		else {
			if (d1 == 31)return 1 + solve(y1, m1 + 1, 1);
			else return 1 + solve(y1, m1, d1 + 1);
		}
	}
}
signed main() {
	int y1, m1, d1;
	while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2, m1 != -1)cout << solve(y1, m1, d1) << endl;
}