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 pb push_back
#define fr first
#define sc second
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> pip; 
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int 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;
    long long int total1=0,total2=0;
    for(int i=0;i<y1;i++){
      if(i%400==0 || (i%100!=0 && i%4==0)){
	total1+=366;
	 
      }else {
	total1+=365;
      }
    }

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

    for(int i=1;i<m1;i++){
      if(i==2){
	if(y1%400==0 || ( y1%100!=0 && y1%4==0)){
	  total1+=29;
	  
	}
	else total1+=28;
      }
      else if(i==4 || i==6 || i==9 || i==11){
	total1+=30;
      }
      else total1+=31;
    }
    
    for(int i=1;i<m2;i++){
      if(i==2){
	if(y2%400==0 || ( y2%100!=0 && y2%4==0)){
	    total2+=29;
	  
	}
	else total2+=28;
      }
      else if(i==4 || i==6 || i==9 || i==11){
	total2+=30;
      }
      else total2+=31;
    }

    total1+=d1;
    total2+=d2;
    cout<< total2-total1<< endl;
  }
}

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

int main(){
  int i,j,y[2],m[2],d[2],f;
  long long ans;
  while(1){
    f = 0;
    for(i=0;i<2;i++){
      cin >> y[i] >> m[i] >> d[i];
      if(y[i] < 0 || m[i] < 0 || d[i] < 0) f++;
    }
    if(f != 0) break;

    ans = (long long)(y[1] - y[0]) * 365 + (m[1] - m[0]) * 30 + d[1] - d[0];

    if(m[0] <= m[1]){
      for(i=m[0];i<m[1];i++){
	if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) ans++;
      }
    }
    else{
      for(i=m[0];i<m[1]+12;i++){
	if(i%12 == 1 || i%12 == 3 || i%12 == 5 || i%12 == 7 || i%12 == 8 || i%12 == 10 || i%12 == 0) ans++;
      }
    }

    for(i=y[0];i<=y[1];i++){
      if(i%4 == 0 && (i%400 == 0 || i%100 != 0)){
	if(i == y[0] && m[0] > 2) continue;
	else if(i == y[1] && m[1] <=2 && d[1] < 29) continue;
	else ans++;
      }
    }

    cout << ans << endl;

  }
  return 0;
}

C++: #include <iostream>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int calc(int y1, int y2) {
	int a;
	a = y2/4 - y1/4;
	if(y2%4==0 || y1%4==0) a++;
	a -= y2/100 - y1/100;
	if(y2%100==0 || y1%100==0) a--;
	a += y2/400 - y1/400;
	if(y2%400==0 || y1%400==0) a++;
	return a;
}
bool uruu(int y) {
	return y%4 == 0 && y%100 != 0 || y%400 == 0;  
}
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)) {
		int uy = calc(y1,y2);
		int ret = (y2-y1+1)*365+uy;
		int day = 0;
		rep(i,m1-1) day += d[i];
		for(int i=11; i>=m2; --i) day += d[i];
		day += d1-1, day += d[m2-1]-d2+1;
		if(uruu(y2) && m2<=2) day++;
		cout << ret - day << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


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

typedef long long ll;
const int md[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

ll calcDays(ll y,ll m,ll d){
	ll sum=0;
	for(ll i = 0; i < y; i++){
		if(checkUru(i)){
			sum+=366;
		}
		else
			sum+=365;
	}
	for(ll i = 1; i < m; i++){
		if(checkUru(i)&&m==2){
			sum+=md[i]+1;
		}
		else
			sum+=md[i];
	}
	sum+=d;
	return sum;
}

int main(){

	ll 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)){
		ll sum=calcDays(y2,m2,d2)-calcDays(y1,m1,d1);
		cout<<sum<<endl;

		//if(y1!=y2){
		//	for(int y = y1+1; y < y2; y++){
		//		if(checkUru(y)){
		//			sum+=366;
		//		}
		//		else
		//			sum+=365;
		//	}
		//	// y1ツづ2ツづ可づつつ「ツづ計ツ算
		//	if(checkUru(y1)){
		//		sum+=(md[m1]-d1);
		//		if(m1==2)
		//			sum++;
		//		for(int m=m1+1; m<=12; m++){
		//			if(m==2)
		//				sum++;
		//			sum+=md[m];
		//		}
		//	}
		//	else{
		//		sum+=(md[m1]-d1);
		//		for(int m=m1+1; m<=12; m++){
		//			sum+=md[m];
		//		}
		//	}
		//	
		//	if(checkUru(y2)){
		//		sum+=(d1);

		//		for(int m=1; m<m2; m++){
		//			if(m==2)
		//				sum++;
		//			sum+=md[m];
		//		}
		//	}
		//	else{
		//		sum+=(d1);
		//		for(int m=1; m<m2; m++){
		//			sum+=md[m];
		//		}
		//	}
		//}
		//else{
		//	if(m1!=m2){
		//		for(int m=m1+1; m < m2; m++){
		//			if(checkUru(y1)&&m==2){
		//				sum+=29;
		//			}
		//			else
		//				sum+=md[m];
		//		}
		//		// m1ツづ2ツづ可づつつ「ツづ計ツ算
		//		if(checkUru(y1)&&m1==2){
		//			sum+=(md[m1]-d1)+1;
		//		}
		//		else
		//			sum+=(md[m1]-d1);

		//		// m2
		//		sum+=d2;

		//	}
		//	else{
		//		sum+=d2-d1;
		//	}
		//}
//		cout<<sum<<endl;
	}

	return 0;
}

C++: #include <iostream>

#define month(m, a) \
		for(int i = 1; i <= m; i++)\
		if(i == 2){\
			a += 28;\
		} else if(i == 4 || i == 6 || i == 9 || i == 11){\
			a += 30;\
		} else {\
			a += 31;\
		}\

using namespace std;

int main(int argc, char **argv)
{
	int y1, m1, d1, y2, m2, d2, a1, a2, a3, a4;
	while(1){
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if(y1 < 0){
			break;
		}
		
		a2 = y2 - y1;
		for(a1 = 0; y1 <= y2; y1++){
			if(y1%400 == 0 || (y1%4 == 0 && y1%100 != 0)){
				a1 += 1;
				y1 += 4;
				break;
			}
		}
		for(; y1 <= y2; y1 += 4){
			if(y1%400 == 0 || y1 % 100 != 0){
				a1 += 1;
			}
		}
		a2 -= a1;
		a4 = a3 = 0;
		month(m1, a3);
		month(m2, a4);

		cout << (a2*365 + a1*366 + a4 - a3 + d2 - d1) << endl;
	}
	
	return 0;
}

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

int main()
{
	while (1)
	{
		int L, R; L = R = 0;
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if (a == -1 ||b == -1 || c == -1 || d == -1|| e == -1 || f == -1)break;
		for (int g = 1; g < a; g++)
		{
			if (g % 400 == 0) L += 366;
			else if (g % 100 == 0) L += 365;
			else if (g % 4 == 0)L += 366;
			else L += 365;
		}
		
		for (int g = 1; g < d; g++)
		{
			if (g % 400 == 0) R += 366;
			else if (g % 100 == 0) R += 365;
			else if (g % 4 == 0)R += 366;
			else R += 365;
		}
		
		for (int h = 1; h < b; h++) {
			switch (h) {
			case 1:case 3:case 5:case 7:case 8:case 10:case 12:L += 31; break;
			case 4:case 6:case 9:case 11:L += 30; break;
			case 2:if (a % 400 == 0) L += 29;
				   else if (a % 100 == 0) L += 28;
				   else if (a % 4 == 0)L += 29;
				   else L += 28;
			}
			}
			
			for (int h = 1; h < e; h++) {
				switch (h) {
				case 1:case 3:case 5:case 7:case 8:case 10:case 12:R += 31; break;
				case 4:case 6:case 9:case 11:R += 30; break;
				case 2:if (a % 400 == 0)R += 29;
					   else if (a % 100 == 0) R += 28;
					   else if (a % 4 == 0)R += 29;
					   else R += 28;
				}
			}
			
		cout << (R + f) - (L + c) << endl;
	}
}