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 getday(int y, int m, int d)
{
  int day = 0;

  for(int i = 1 ; i < y ; i++) {
    day += 365;
    if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0) day += 1;
      }

  for(int i = 1 ; i < m ; i++) {
    day += 30;
    if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) day++;
    if(i == 2)  day -= 2;
  }
  for(int i = 0 ; i < d ; i++) {
    day++;
  }
  return day;
}


int main(void)
{
  int y1, m1, d1, y2, m2, d2;
  int day1, day2;
  int year;
  
  while(1) {
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;
    day1 = getday(y1, m1, d1);
    day2 = getday(y2, m2, d2);
    
    cout << day2 - day1 << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int GregorianDay(int y, int m, int d) {
    y += 4800;
    if (m < 3) {--y; m += 12;}
    return 365*y+y/4-y/100+y/400+(153*m-457)/5+d-32083;
}

int main() {
    int y[2], m[2], d[2];
    while (cin >> y[0] >> m[0] >> d[0] >> y[1] >> m[1] >> d[1]) {
        if (y[0] == -1) break;
        int day[2];
        for (int i = 0; i < 2; ++i) day[i] = GregorianDay(y[i], m[i], d[i]);
        cout << day[1] - day[0] << endl;
    }
}

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

int main(){

  long long int y1,m1,d1,y2,m2,d2;
  long long int ans = 0;
  int m[] = {31,28,31,30,31,30,31,31,30,31,30,31};

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

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

    for(int i=0;i<m1;i++) ans -= m[i];
    if((y1%400 == 0 || (y1%4 == 0 && y1%100 != 0)) && m1 > 2) ans--;
    ans -= d1;

    for(int i=0;i<m2;i++) ans += m[i];
    if((y2%400 == 0 || (y2%4 == 0 && y2%100 != 0)) && m1 > 2) ans++;
    ans += d2;

    cout << ans << endl;

  }
}

C++: #include<iostream>

int leap(int y,bool flag);
int monthday(int m);

int main()
{
	int y1,m1,d1;
	int y2,m2,d2;
	int c1,c2;// Day count from 1/1/1 to y1/m1/d1
	int daycount;

	while(1)
	{
		std::cin>>y1>>m1>>d1>>y2>>m2>>d2;
		if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0)break;
		
		c1=(y1-1)*365+leap(y1,m1<=2)+monthday(m1)+d1-1;
		c2=(y2-1)*365+leap(y2,m2<=2)+monthday(m2)+d2-1;
		daycount=c2-c1;
		std::cout<<daycount<<std::endl;
	}
	return 0;
}

int leap(int y,bool flag)
{
	int count;
	bool isleap;
	if(y%4==0)
	{
		isleap=true;
		if(y%100==0)
		{
			isleap=false;
			if(y%400==0)isleap=true;
		}
	}
	count=y/4-y/100+y/400;
	if(isleap&&flag)count--;
	return count;
}

int monthday(int m)
{
	int count=0;
	int days[11]={31,28,31,20,31,30,31,31,30,31,30};
	for(int i=0;i<m;i++)
	{
		count+=days[i];
	}
	return count;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

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

int daycount(int y, int m, int d) {
	int res = 0;
	int ny = 1, nm = 1;
	
	while (true) {
		if (ny == y && nm == m) {
			res += d;
			break;
		}
		
		int plus = 31;
		if (nm == 2 || nm == 4 || nm == 6 || nm == 9 || nm == 11) plus--;
		if (nm == 2) {
			plus--;
			if (!isleap(ny)) plus--;
		}
		
		res += plus;
		
		if (++nm == 13) {
			ny++;
			nm = 1;
		}
	}
	return res;
}

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;
		
		cout << daycount(y2, m2, d2) - daycount(y1, m1, d1) << endl;
	}
	return 0;
}

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

//                                1   2   3   4   5   6   7   8   9  10  11  12
int normal_days_of_month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool is_uruu(int year) {
    if (year % 400 == 0) {
        return true;
    }
    if (year % 4 == 0 && year % 100 != 0) {
        return true;
    }
    return false;
}

int all_days_of_ym(int year, int month) {
    if (month == 2 && is_uruu(year)) {
        return 29;
    }
    return normal_days_of_month[month];
}

int imamade_days_of_ymd(int year, int month, int day) {
    int result = 0;
    for (int im=1; im<month; im++) {
        result += all_days_of_ym(year, im);
    }
    result += day;
    return result;
}

int all_days_of_year(int year) {
    return imamade_days_of_ymd(year, 12, 31);
}

int nokori_days_of_ymd(int year, int month, int day) {
    return all_days_of_year(year) - imamade_days_of_ymd(year, month, day);
}

int minus_days_ymd(int y1, int m1, int d1, int y2, int m2, int d2) {
    if (y1 == y2) {
        return imamade_days_of_ymd(y2, m2, d2) - imamade_days_of_ymd(y1, m1, d1);
    }
    int result=0;
    result += nokori_days_of_ymd(y1, m1, d1);
    int iy;
    for (iy=y1+1; iy<y2; iy++) {
       result += all_days_of_year(iy);
    }
    result += imamade_days_of_ymd(y2, m2, d2);
    return result;
}

int main(void){
    int y1, m1, d1, y2, m2, d2;
    while (1) {
        cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
        if (y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0) {
            break;
        }
        cout << minus_days_ymd(y1, m1, d1, y2, m2, d2) << endl;
    }
    return 0;
}