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; //1y1m1d
  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 % 400 == 0)++res;
  else if(m > 2 && y % 100 != 0 && y % 4 == 0)++res;
  --y; res += y * 365 + y / 4 - y / 100 + y / 400;
  --d; res += d;
  return res;
}

signed main(void){
  int i, j;
  //pri(daycnt(1, 1, 1));
  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++: #include<stdio.h>
#include<iostream>
using namespace std;

int main(){
int sc[14]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int yd=365;
int y1,y2,m1,m2,d1,d2;
bool f=false;
while(1){
	bool FB=false;
cin>>y1>>m1>>d1>>y2>>m2>>d2;
if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0)break;
int by=y1;
int ay=y2;
long dc=0;
if((by%4==0&&by%100!=0)||by%400==0){f=true;sc[2]=29;}

if(by!=ay){
for(int i=m1;i<=12;i++)
dc+=sc[i];
dc-=d1-1;FB=true;
by++;

for(int i=by;i<ay;i++){
if((i%4==0&&i%100!=0)||by%400==0)dc+=366;
else {dc+=365;}
}
by=ay;
m1=1;d1=1;
}
if((by%4==0&&by%100!=0)||by%400==0){f=true;sc[2]=29;}
else sc[2]=28;
for(int i=m1;i<m2;i++)
dc+=sc[i];

dc+=d2;
//if(FB==false)
dc-=d1;
cout<<dc<<endl;
}
return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

int uru(int y){
	return y%4==0 && (y%100!=0 || y%400==0);
}

int day(int y,int m,int d){
	int days=0;
	for(int i=1;i<=y-1;i++)days+=uru(i)+365;
	
	if(m>1)days+=31;
	if(m>2)days+=28+uru(y);
	if(m>3)days+=31;
	if(m>4)days+=30;
	if(m>5)days+=31;
	if(m>6)days+=30;
	if(m>7)days+=31;
	if(m>8)days+=31;
	if(m>9)days+=30;
	if(m>10)days+=31;
	if(m>11)days+=30;
	
	days+=d-1;
	return days;
}

main(){
	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;
		
		cout<<day(y2,m2,d2)-day(y1,m1,d1)<<endl;
	}
}

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

int y[2],m[2],d[2];

ll calc(int,int,int);

int main(){
  ll a,b;

  while(cin>>y[0]>>m[0]>>d[0]>>y[1]>>m[1]>>d[1]){
    if(y[0]<0||m[0]<0||d[0]<0||y[1]<0||m[1]<0||d[1]<0)break;
    a=calc(y[0],m[0],d[0]);
    b=calc(y[1],m[1],d[1]);
    cout<<b-a<<endl;
  }

}

ll calc(int y,int m,int d){
  int t[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

  //365+365+365+366==1461   4year
  //1461*25-1==36524      100year
  //36524*4+1==146097     400year
  if(y%4==0&&(y%100!=0||y%400==0)){
    t[2]=29;
  }
  y+=3;
  ll res=0;
  res+=146097*(y/400);y%=400;
  res+=36524*(y/100);y%=100;
  res+=1461*(y/4);y%=4;
  res+=365*y;
  
  int cnt=0;
  
  for(int i=1;i<=m;i++){
    for(int j=1;j<=(i==m?d:t[i]);j++){
      cnt++;
    }
  }
  
  return res+cnt;
}

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

int main(){
    long long days1,days2;
    int y1,m1,d1,y2,m2,d2;
    while(1){
        days1 = 0;
        days2 = 0;
        cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
        if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;
        for(int i=1;i<y1;i++){
            if((i%4 == 0 && i%100 != 0) || i%400 == 0) days1 += 366;
            else days1 += 365;
        }
        for(int i=1;i<y2;i++){
            if((i%4 == 0 && i%100 != 0) || i%400 == 0) days2 += 366;
            else days2 += 365;
        }
        for(int i=1;i<m1;i++){
            switch(i){
                case 4:
                case 6:
                case 9:
                case 11:
                    days1 += 30;
                    break;
                case 2:
                    if((i%4 == 0 && i%100 != 0) || i%400 == 0) days1 += 29;
                    else days1 += 28;
                    break;
                default:
                    days1 += 31;
                    break;
            }
        }
        for(int i=1;i<m2;i++){
            switch(i){
                case 4:
                case 6:
                case 9:
                case 11:
                    days2 += 30;
                    break;
                case 2:
                    if((i%4 == 0 && i%100 != 0) || i%400 == 0) days2 += 29;
                    else days2 += 28;
                    break;
                default:
                    days2 += 31;
                    break;
            }
        }
        days1 += d1;
        days2 += d2;
        cout << days2 - days1 << endl;
    }
}