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 <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;
        int 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("%d\n", res);
    }
}

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

int fairfiled(int y,int m,int d){
	if(m<3){
		--y;
		m+=12;
	}
	return 365*y+(y/4)-(y/100)+(y/400)+(206*(m+1)/10)+d-428;
}

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

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


const int n_day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
struct Date {
  // year, month, day, a day of the week
  int y, m, d, e;
  Date() {}
  Date(int y, int m, int d, int e = -1) : y(y), m(m), d(d), e(e) {}
 
  bool operator < (const Date &o) const {
    if(y != o.y) return y < o.y;
    if(m != o.m) return m < o.m;
    return d < o.d;
  }
 
  bool isLeapYear() {
    if(y % 400 == 0) return true;
    if(y % 100 == 0) return false;
    if(y % 4 == 0) return true;
    return false;
  }

  int getDays() {
    int nd = n_day[m];
    if(m == 2) nd += isLeapYear();
    return nd;
  }

  void next() {
    e = (e+1)%7;
    if(d == getDays()) {
      d = 1;
      if(m == 12) {
        m = 1;
        ++y;
      } else {
        ++m;
      }
    } else {
      ++d;
    }
  }
 
  void back() {
    e = (e+6)%7;
    if(d == 1) {
      if(m == 1) {
        m = 12;
        --y;
      } else {
        --m;
      }
      d = getDays();
    } else {
      --d;
    }
  }
};

// AOJ 0125
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;
    Date d(y1,m1,d1), end(y2,m2,d2);
    int res = 0;
    while(d < end) {
      ++res;
      d.next();
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int y1, m1, d1, y2, m2, d2;
	const int m[12] = { 31,30,31,30,31,30,31,31,30,31,30,31 };
	while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2&&y1 >= 0 && m1 >= 0 && d1 >= 0 && y2 >= 0 && m2 >= 0 && d2 >= 0) {
		long long sum = 0;
		for (int i = y1 + 1; i <= y2 - 1; i++) {
			if (i % 4 == 0) {
				if (i % 100 == 0) {
					if (i % 400 == 0)
						sum += 366;
					else
						sum += 365;
				}
				else
					sum += 366;
			}
			else
				sum += 365;
			sum--;
		}
		if (y2 - y1 > 0) {
			for (int i = m1; i < 12; i++) {
				sum += m[i];
			}
			sum += (m[m1 - 1] - d1);
			for (int i = 0; i < m2-1; i++) {
				sum +=m[i];
			}
			sum += (d2);
		}
		else {
			for (int i = m1; i <= m2-2; i++) {
				sum += m[i];
			}
			if (m2 - m1 > 0) {
				sum += (m[m1 - 1] - d1);
				sum += (d2);
			}
			else {
				sum += (d2 - d1);
			}
		}
		cout << sum << endl;
	}
}

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

int uru(int y){
	if(y%4==0){
		if(y%100==0){
			if(y%400==0){
				return 1;
			}
			return 0;
		}
		return 1;
	}
	return 0;
}
	


int main(){
	int m[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int y1,m1,d1;
	int y2,m2,d2;
	int sum;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
		if(y1<0&&m1<0&&d1<0)break;
		if(y2<0&&m2<0&&d2<0)break;
		sum=0;
		
		for(int i=y1;i<y2;i++){
			sum+=365+uru(i);
			//cout<<"a";
			}
		for(int i=m1;i<m2;i++){
			sum+=m[i];
			if(i==2)sum+=uru(y1);
			//cout<<"b";
			
		}		
	
		sum+=d2-d1;
		cout<<sum<<endl;
	}
}

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

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

int dc(int y,int m,int d) {
    int res = 0;
    for(int i=1; i<y; ++i) {
        res += 365;
        if(isleap(i)) res++;
    }

    for(int i=1; i<m; ++i) {
        res += 31;
        if(i == 4 || i == 6 || i == 9 || i == 11) res--;
        if(i == 2) {
            res -= 3;
            if(isleap(y)) res++;
        }
    }
    res += d-1;
    return res;
}

int main() {
    int y1,y2,m1,m2,d1,d2;
    while(cin>>y1>>m1>>d1>>y2>>m2>>d2) {
        if(y1 == -1 && y2 == -1) break;

        else cout<<dc(y2,m2,d2)-dc(y1,m1,d1)<<endl;
    }
}