Go: package main

import (
	"bufio"
		"os"
	"strings"
	"strconv"
		"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)))
		fmt.Println(ut2jd(ele_t2[0], ele_t2[1], ele_t2[2])-ut2jd(ele_t1[0], ele_t1[1], ele_t1[2]))
	}
}

func ut2jd(year, month, day int) int {
	if month <= 2 {
		year--
		month += 12
	}
	s := 3 + year/4 - year/100 + year/400
	s += 1720994 + year*365 + (month+1)*30 + (month+1)*3/5 + day
	return s
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rrep(i,n) for(int i=(int)(n)-1; i>=0; i--)
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define pr(a) cout << (a) << endl
#define PR(a,b) cout << (a) << " " << (b) << endl
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000001;
const ll MAXL=1000000000000000001LL;
const ll mod=1000000007;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

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

int main() {
  int y1,y2,m1,m2,d1,d2;
  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2) {
    if(y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0) break;
    int D1=days(y1,m1,d1);
    int D2=days(y2,m2,d2);
    pr(D2-D1);
  }
  return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int pls[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 31, 30, 31};

int calc(int y, int m, int d){
  --y;
  int res = d + (y / 4 - y / 100 + y / 400) + y * 365;
  ++y;
  if((y % 4 && (!(y % 100) || y % 400)) && (m >= 3 || (m == 2 || d == 29))) ++res;
  REP(i, m + 1) res += pls[i];
  return res;
}

int main() {
  int y1, m1, d1, y2, m2, d2;
  while(cin >>y1 >>m1 >>d1 >>y2 >>m2 >>d2 && (y1 >= 0 && m1 >= 0 && d1 >= 0 && y2 >= 0 && m2 >= 0 && d2 >= 0)) cout <<calc(y2, m2, d2) - calc(y1, m1, d1) <<endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int day[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    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 ans = 0;
        bool success = false;
        for (int i = y1, j = m1, k = d1; i <= y2; i++) {
            for (j; j <= 12; j++) {
                for (k; k <= day[j]; k++) {
                    if (i == y2 && j == m2 && k == d2) {
                        goto fin;
                    }
                    ans++;
                }
                k = 1;
            }
            j = 1;
            if (i % 100 == 0) {
                if (i % 400 == 0) {
                    ans++;
                }
            }
            else if (i % 4 == 0) {
                ans++;
            }
        }
    fin:;
        cout << ans << endl;
    }
    return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int is_leap(int y){
  if(y % 400 == 0) return 366;
  else if(y % 100 == 0) return 365;
  else if(y % 4 == 0) return 366;
  return 365;
}
const int days[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll y,y2,d,d2,m,m2;
  while(cin >> y >> m >> d >> y2 >> m2 >> d2){
    if(y < 0 || m < 0 || d < 0 || y2 < 0|| m2 < 0|| d2 < 0) break;
    ll ans = 0;
    rep(i,m){
      ans -= days[i];
    }
    if(is_leap(y) == 366 && m > 2) --ans;
    ans -= d;
    while(y2 - y != 0){
      ans += is_leap(y);
      ++y;
    }
    rep(i,m2){
      ans += days[i];
    }
    if(is_leap(y2) == 366 && m2 > 2) ++ans;
    ans += d2;
    cout << ans << endl;
  }
  return 0;
}

C++: #include <cstdio>

int y1, m1, d1, y2, m2, d2;

int day[2][12]={

{31,28,31,30,31,30,31,31,30,31,30,31},

{31,29,31,30,31,30,31,31,30,31,30,31}

};

bool uruu(int year) {

    if (year%400==0) return true;

    else if (year%100==0) return false;

    else if (year%4==0) return true;

    else return false;

}

int main() {

    while (scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)) {

        if (y1==-1&&m1==-1&&d1==-1&&y2==-1&&m2==-1&&d2==-1) break;

        long long res = 0, flag;

        if (y1==y2) {

            if (uruu(y1)) flag = 1;

            else flag = 0;

            if (m1==m2) res = d2-d1;

            else {

                for (int i=m1; i<m2-1; i++) res += day[flag][i];

                res += day[flag][m1-1] - d1;

                res += d2;

            }

        } else {

            if (uruu(y1)) flag = 1;

            else flag = 0;

            for (int i=m1; i<12; i++) res += day[flag][i];

            res += day[flag][m1-1] - d1;

            for (int i=y1+1; i<y2; i++) {

                if (uruu(i)) res += 366;

                else res += 365;

            }

            if (uruu(y2)) flag = 1;

            else flag = 0;

            for (int i=0; i<m1-1; i++) res += day[flag][i];

            res += d2;

        }

        printf("%lld\n", res);

    }

}