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>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

int daycnt(int y, int m, int d){
  ll res = 0; //0y1m1d == 0or1
  --y; res += y * 365 + y / 4 - y / 100 + y / 400;
  if(m == 2)res += 31;
  else if(m == 3)res += 59;
  else if(m == 4)res += 90;
  else if(m == 5)res += 120;
  else if(m == 6)res += 151;
  else if(m == 7)res += 181;
  else if(m == 8)res += 212;
  else if(m == 9)res += 243;
  else if(m == 10)res += 273;
  else if(m == 11)res += 304;
  else if(m == 12)res += 334;
  if(m > 2 && y % 4 == 0)++res;
  --d; res += d;
  return res;
}

signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int y, m, d, x, l, c;
    scanf("%d%d%d%d%d%d", &y, &m, &d, &x, &l, &c);
    if(y < 0 || m < 0 || d < 0 || x < 0 || l < 0 || c < 0)break;

    pri(daycnt(x, l, c) - daycnt(y, m, d));

//*/

//*/ break;
  }
  return 0;
}

C++: import java.util.*;

public class Main {
    static final int[] days = {0,31,28,31,30,31,30,31,31,30,31,30,31};

    public static boolean isUruu(int y) {
	return (y%4 == 0 && y%100 != 0) || y%400 == 0;
    }

    public static int getDays(int y,int m,int d) {
	int res = 0;
	for(int i = 1; i <= y-1; ++i) {
	    if(isUruu(i)) res += 366;
	    else     res += 365;
	}
	for(int i = 1; i <= m-1; ++i) {
	    res += days[i];
	    if(i == 2 && isUruu(y)) ++res;
	}
	res += d;
	return res;
    }

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	while(true) {
	    int d[][] = new int[2][3];
	    boolean flag = false;
	    for(int i = 0; i < 2; ++i) {
		for(int j = 0; j < 3; ++j) {
		    d[i][j] = s.nextInt();
		    if(d[i][j] < 0) flag = true;
		}
	    }
	    if(flag) break;
	    System.out.println(Math.abs(getDays(d[1][0],d[1][1],d[1][2])-getDays(d[0][0],d[0][1],d[0][2])));
	}
    }
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
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;

typedef long long ll;

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

ll Day(int y, int m, int d) {
	ll ret = d;

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

	int sum = 0;
	for (int i = 1; i <= 12; ++i) sum += mon[i];

	mon[2] = uruu(y) ? 29 : 28;
	for (int i = 1; i < m; ++i) ret += mon[i];

	for (int i = 1; i < y; ++i) {
		if (uruu(i)) ret += sum+1;
		else ret += sum;
	}

	return ret;
}

int main() {
	int y1, m1, d1, y2, m2, d2;
	while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2, y1 > -1) {
		cout << ( Day(y2, m2, d2) - Day(y1, m1, d1) ) << endl;
	}
}

C++: #include<stdio.h>
int main(void){
	int y1,m1,d1,y2,m2,d2;
	int i;
	int y1day,y2day;
	while(1){
		scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
		y1day=0;
		y2day=0;
		if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1  || d2==-1) {
			break;
		}
		y1day=y2day=0;
		for(i=1;i<y1;i++){
			y1day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y1day++;
		}
		for(i=1;i<m1;i++){
			y1day+=31;
			if(i==4 || i==6 || i==9 || i==11) y1day-=1;
			if(i==2){
				y1day-=1;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y1day-=1;
			}
		}
		y1day+=d1;
		for(i=1;i<y2;i++){
			y2day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y2day++;
		}
		for(i=1;i<m2;i++)	{
			y2day+=31;
			if(i==4 || i==6 || i==9 || i==11) y2day-=1;
			if(i==2){
				y2day-=1;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y2day-=1;
			}
		}
		y2day+=d2;
	//	printf("%d %d\n",y1day,y2day);
		printf("%d\n",y2day-y1day);
	}
	return 0;
}

C++: //#include <bits/stdc++.h>
#include <iostream>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
//typedef vector<int> vint;
typedef pair<int,int> pii;

int y1,m1,d1,y2,m2,d2;
int md[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int mdl[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};

bool leap_year(int y){
	if(y%4==0 && y%100!=0 || y%400==0) return true;
	else return false;
}

int days(int y,int m,int d){
	int ans=0,cm=1;
	while(1){
		if(cm==m){
			ans+=d; break;
		}
		else if(leap_year(y)) ans+=mdl[cm];
		else ans+=md[cm];
		cm++;
	}
	return ans;
}

int main(){
	while(1){
		int ans=0;
		cin>>y1>>m1>>d1>>y2>>m2>>d2;
		if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0) break;
		while(1){
			if(y1==y2) break;
			else if(leap_year(y1)) ans+=366;
			else ans+=365;
			y1++;
		}
		ans+=days(y2,m2,d2)-days(y1,m1,d1);
		o(ans);
	}
}