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<iostream>
using namespace std;

int main(){

  int y1,m1,d1,y2,m2,d2;
  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<bits/stdc++.h>
using namespace std;
int main()
{
    int year[2],month[2],day[2];
    while(cin>>year[0]>>month[0]>>day[0]>>year[1]>>month[1]>>day[1]){
        bool en=0;
        for(int i=0;i<2;i++)if(year[i]<0||month[i]<0||day[i]<0)en=1;
        if(en)break;
        int ans=0;
        for(int i=year[0];i<=year[1];i++){
            ans+=365;
            if(i%4==0&&i%100!=0||i%400==0)ans+=1;
        }
        ans+=day[1]-day[0]+1;
        for(int i=1;i<month[0];i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        if((year[0]%4==0&&year[0]%100!=0||year[0]%400==0)&&month[0]>=2)ans-=1;
        for(int i=month[1];i<13;i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        if((year[1]%4==0&&year[1]%100!=0||year[1]%400==0)&&month[1]<=2)ans+=1;
        cout<<ans-1<<endl;
    }
}

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

int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int lmonth[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};

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;
    int day1 = 0,day2 = 0;

    //day    
    day1 += d1;
    day2 += d2;

    //month
    if(y1 % 4 == 0) {
      if(y1 % 100 == 0 && y1 % 400 != 0){
	for(int i=1;i<m1;i++)
	  day1 += month[i];
      }
      else {
	for(int i=1;i<m1;i++)
	  day1 += lmonth[i];
      }
    }
    else {
      for(int i=1;i<m1;i++)
	day1 += month[i];
    } 

    if(y2 % 4 == 0) {
      if(y2 % 100 == 0 && y2 % 400 != 0){
	for(int i=1;i<m2;i++)
	  day2 += month[i];
      }
      else {
	for(int i=1;i<m2;i++)
	  day2 += lmonth[i];
      }
    }
    else {
      for(int i=1;i<m2;i++)
	day2 += month[i];
    } 
    


    //year
    for(int i=1;i<y1;i++) {
      if(i % 4 == 0) {
	if(i % 100 == 0 && i % 400 != 0){
	  day1 += 365;
	}
	else {
	  day1 += 366;
	}
      }
      else {
	day1 += 365;
      }
    }

    for(int i=1;i<y2;i++) {
      if(i % 4 == 0) {
	if(i % 100 == 0 && i % 400 != 0){
	  day2 += 365;
	}
	else {
	  day2 += 366;
	}
      }
      else {
	day2 += 365;
      }
    }
    
    cout << day2-day1 << endl;
  }
}

C++: #include<iostream>
#include<list>
#include<string>
#include<map>
#include<vector>
using namespace std;
bool step(int y2) {
 if ((y2) % 4 == 0) {
  if ((y2) % 100 == 0) {
   if ((y2) % 400 == 0)
    return true;
   else
    return false;
  }
  else
   return true;
 }
 else
  return false;
}
int main(){
 int y1, m1, d1, y2, m2, d2;
 int m[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
 while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 && y1>=0) {
  int y3 = y2, d3 = d2;
  if(y2<y1){
	  swap(y1,y2);
	  swap(m1,m2);
	  swap(d1,d2);
  }
  else if(y2==y1){
	  if(m2<m1){
		  swap(m1,m2);
		  swap(d1,d2);
	  }
	  else if(m2==m1){
		  if(d2<d1){
			  swap(d1,d2);
		  }
	  }
  }
  while (y2 != y1) {
   y2--;
   if (step(y2)&&y2!=y1)
    d2 += 366;
   else
    d2 += 365; 
  }
  if (step(y3) && m2 >= 2)
   d2++;
  while (m2 < m1) {
   m2++;
   if (m2 == 2 && step(y1))
    d2--;
   d2 -= m[m2-1];
  }
  while (m2 > m1) {
   m2--;
   if (m2 == 2 && step(y1))
    d2++;
   d2 += m[m2 - 1];
  }
  d2 -= d1;
  cout <<d2<< endl;
 }
 int lk;
 cin >> lk >> lk;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int year[2],month[2],day[2];
    while(cin>>year[0]>>month[0]>>day[0]>>year[1]>>month[1]>>day[1]){
        bool en=0;
        for(int i=0;i<2;i++)if(year[i]<0||month[i]<0||day[i]<0)en=1;
        if(en)break;
        int ans=0;
        for(int i=year[0];i<=year[1];i++){
            ans+=365;
            if(i%4==0&&i%100!=0||i%400==0)ans+=1;
        }
        if((year[0]%4==0&&year[0]%100!=0||year[0]%400==0)&&month[0]>=2)ans-=1;
        if((year[1]%4==0&&year[1]%100!=0||year[1]%400==0)&&month[1]<=2)ans+=1;
        for(int i=1;i<month[0];i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        for(int i=month[1];i<13;i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        ans+=day[1]-day[0];
        cout<<ans<<endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <sstream>
#include <map>
using namespace std;
typedef long long ll;

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

ll ytod(int y){
	ll days = 0;
	int a = y / 4 - y / 100 + y / 400;
	return (y - a) * 365 + a * 366;
}

ll mtod(int y, int mo){
	ll day = 0;
	for(int i = 0; i < mo - 1; i++){
		day += m[i];
		if(i == 1 && (y % 4 == 0 && (y % 400 == 0 || y % 100 != 0))) day++;
	}
	return day;
}

ll get_day(int a, int b,int c){
	ll day = ytod(a - 1) + mtod(a, b) + c;
	return day;
}

int main(){
	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		if(a == -1 && b == -1 && c == -1 && d == -1 && e == -1 && f == -1) break;
		ll day1 = get_day(a, b, c);
		ll day2 = get_day(d, e, f);
		cout << day2 - day1 << endl;;
	}
	return 0;
}