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>
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;
    }
}