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;

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

int main(){
	int month[] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f,a >= 0){
		int x = c,y = f;
		for(int i = 0;i < a;i++){
			if(is_uruu(i)) x += 366;
			else x += 365;
		}
		for(int i = 0;i < d;i++){
			if(is_uruu(i)) y += 366;
			else y += 365;
		}
		for(int i = 0;i < b - 1;i++){
			if(i == 1 && is_uruu(a)) x += 29;
			else x += month[i];
		}
		for(int i = 0;i < e - 1;i++){
			if(i == 1 && is_uruu(d)) y += 29;
			else y += month[i];
		}
		cout << y - x << endl;
	}
	return 0;
}

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

int year(int y){
    if( y%400 == 0 ) return 366;
    if( y%100 == 0 ) return 365;
    if( y%4 == 0 ) return 366;
    return 365;
}

int daysOfMonth(int y, int m){
    static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    if( m != 2 ) return days[m];
    if( year(y) == 366 ) return 29;
    return 28;
}

int daysFromBegin(int y, int m, int d){
    int ans = 0;
    for(int i = 1; i < m; i++){
        ans += daysOfMonth(y, i);
    }
    ans += d - 1;
    return ans;
}

int main(){
    int y1, m1, d1, y2, m2, d2;
    while( cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 ){
        if( y1 < 0 || y1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0 ){
            break;
        }
        int ans = 0;
        ans += -daysFromBegin(y1, m1, d1) + daysFromBegin(y2, m2, d2);
        for(int yy = y1; yy < y2; yy++){
            ans += year(yy);
        }
        cout << ans << endl;
    }
    return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

#define iso(i) (i%400==0||(i%100!=0 &&i%4==0))

int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int OY = 366, SUMY = 365;

int main()
{
    int y1, m1, d1, y2, m2, d2;
    while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2)
    {
        if(y1<0 || m1<0 || y1 < 0 || y2 <0 || m2<0 || d2<0) break;

        int ans = 0;
        //cout << "year" <<y1 << " " << y2 << endl;
        if( y1 < y2) for(int i=y1 + 1;i < y2;i++)
        {   
            if(iso(i))ans += OY;
            else ans += SUMY;
        }

        if(y1< y2)
        {
            for(int i = m1+1;i < 13; i++) ans += month[i];
            if(m1 < 2 &&iso(y1) ) ans++;

            for(int i = 1; i< m2;i++) ans += month[i];
            if(m2>=2 && iso(y2))ans++;
        }
        else
        {
            if(m1<m2)for(int i = m1+1;i < m2;i++) ans += month[i];
            if(m1 < 2 && m2 >= 2 && iso(y1)) ans++;
        }

        if(y1 < y2 ||(y1 == y2 && m1 < m2) )
        {
            ans += month[m1] - d1 + 1;
            if(d1 == 2 && iso(y1)) ans++;
            ans += d2 - 1;
        }
        else ans += d2 - d1;

        cout << ans << endl;
    }

    return 0;
}

C++: #include<iostream>
using namespace std;
bool foo(int a){
  if(a % 400 == 0) return true;
  else if(a % 100 == 0) return false;
  else if(a % 4 == 0) return true;
  else return false;
}
int main(void){
  int y1,m1,d1,y2,m2,d2;
  int m[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
  unsigned long long a1,a2;
  for( ; ; ){
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;

    a1 = a2 = 0;

    for(int i = 0;i < y1; i++){
      if(foo(i)) a1 += 366;
      else a1 += 365;
    }

    for(int i = 0;i < y2; i++){
      if(foo(i)) a2 += 366;
      else a2 += 365;
    }

    for(int i = 1;i < m1; i++) a1 += m[i];
    for(int i = 1;i < m2; i++) a2 += m[i];

    a1 += d1;
    a2 += d2;

    if(m1 >= 3){
      if(foo(y1)) a1++;
    }
    if(m2 >= 3){
      if(foo(y2)) a2++;
    }
    
    cout << a2 - a1 << endl;
  }
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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

    for(;;){
        int y[2], m[2], d[2];
        for(int i=0; i<2; ++i){
            cin >> y[i] >> m[i] >> d[i];
            if(y[i] < 0 || m[i] < 0 || d[i] < 0)
                return 0;
        }

        int sum[2] = {0};
        for(int i=0; i<2; ++i){
            for(int j=1; j<y[i]; ++j){
                sum[i] += 365;
                if(j % 400 == 0 || (j % 100 != 0 && j % 4 == 0))
                    ++ sum[i];
            }
            for(int j=1; j<m[i]; ++j){
                sum[i] += month[j];
                if(j == 2 && (y[i] % 400 == 0 || (y[i] % 100 != 0 && y[i] % 4 == 0)))
                    ++ sum[i];
            }
            sum[i] += d[i];
        }

        cout << (sum[1] - sum[0]) << endl;
    }
}

C++: #include <iostream>

constexpr int days[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
constexpr int ldays[12] = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
bool is_leap_year(const int &n) {
	return (n % 400 == 0) || ((n % 100 != 0) && (n % 4 == 0));
}
void swap(int &ay, int &am, int &ad, int &by, int &bm, int &bd) {
	int y{ ay }, m{ am }, d{ ad };
	ay = by; am = bm; ad = bd; by = y; bm = m; bd = d;
}
bool foward(const int &ay, const int &am, const int &ad, const int &by, const int &bm, const int &bd) {
	return (ay < by) || ((ay == by) && ((am < bm) || (am == bm && ad < bd)));
}
int days_from_new_years_day(const int &y, const int &m, const int &d) {
	return (is_leap_year(y)) ? ldays[m - 1] + d - 1 : days[m - 1] + d - 1;
}
int days_among(int from_year, int from_month, int from_day, int to_year, int to_month, int to_day) {
	if (!foward(from_year, from_month, from_day, to_year, to_month, to_day)) swap(from_year, from_month, from_day, to_year, to_month, to_day);
	int res = days_from_new_years_day(to_year, to_month, to_day) - days_from_new_years_day(from_year, from_month, from_day);
	for (auto y = from_year; y < to_year; ++y) {
		if (is_leap_year(y)) res += 366;
		else res += 365;
	}
	return res;
}
int main() {
	int fy, fm, fd, ty, tm, td;
	for (; std::cin >> fy >> fm >> fd >> ty >> tm >> td && fy >= 0 && fm >= 0 && fd >= 0 && ty >= 0 && tm >= 0 && td >= 0;) {
		std::cout << days_among(fy, fm, fd, ty, tm, td) << std::endl;
	}
	return 0;
}