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 <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 if(i == 2) ans -= 2;
      }
    }
    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++;
	else if(i%12 == 2) ans -= 2;
      }
    }


    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) continue;
	else ans++;
      }
    }

    cout << ans << endl;

  }
  return 0;
}

C++: // Tazoe

#include <iostream>
using namespace std;

int calc(int y, int m, int d)
{
	int M[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	int days = 0;
	for(int i=1; i<m; i++){
		days += M[i-1];

		if(i==2&&(y%400==0||(y%100!=0&&y%4==0))){
			days++;
		}
	}

	return days+d;
}

int main()
{
while(true){
	int y1, m1, d1, y2, m2, d2;
	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0)  break;
	int sum = 0;
	for(int i=y1; i<y2; i++){
		sum += 365;

		if(i%400==0||(i%100!=0&&i%4==0)){
			sum++;
		}
	}

	const int M[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	for(int i=1; i<m2; i++){
		sum += M[i-1];

		if(i==2&&(y2%400==0||(y2%100!=0&&y2%4==0))){
			sum++;
		}
	}
	sum += d2;

	for(int i=1; i<m1; i++){
		sum -= M[i-1];

		if(i==2&&(y1%400==0||(y1%100!=0&&y1%4==0))){
			sum--;
		}
	}
	sum -= d1;

	cout << sum << '\n';
}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;


int days(int y,int m,int d){
	if(m<=2){
		y--; m+=12;
	}
	return 365*y+y/4-y/100+y/400+306*(m+1)/10+d-429;
}

int main(){
	int y1,m1,d1,y2,m2,d2;
	while(1){
		cin>>y1>>m1>>d1>>y2>>m2>>d2;
		if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0) break;
		o(days(y2,m2,d2)-days(y1,m1,d1));
	}
}

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

C++: #include <iostream>
using namespace std;
int month[12]={30,28,31,30,31,30,31,31,30,31,30,31};
int count(int y,int m,int d){//1/1/1~y/m/d?????\??°(1/1/1=1)
	int num=0;
	if((!(y%4)&&(y%100))||(!(y%400)))month[1]=29;
	for(int i=0;i<m;i++){
		num+=month[i];
	}
	num+=d;
	month[1]=28;
	return num;
}
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 ans=0;
		if(y1==y2){
			ans=count(y2,m2,d2)-count(y1,m1,d1);
		}else if(y2-y1==1){
			ans=365-count(y1,m1,d1)+count(y2,m2,d2);
			if((!(y1%4)&&(y1%100))||(!(y1%400)))ans++;
		}else{
			y1++;y2--;
			ans+=(y2-y1+1)*365+(y2/4-y2/100+y2/400)-((y1-1)/4-(y1-1)/100+(y1-1)/400);
			ans+=count(++y2,m2,d2)+365-count(--y1,m1,d1);
			if((!(y1%4)&&(y1%100))||(!(y1%400)))ans++;
		}
		cout<<ans<<endl;

	}
    return 0;
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

ll solve(int y,int m,int d){
    int x[]={31,28,31,30,31,30,31,31,30,31,30,31};
    int month[12]={31};
    
    for(int i=1;i<12;i++){
        month[i]=month[i-1]+x[i];
    }
    
    ll ret=0;
    ret+=(y-1)*365;
    ret+=(y-1)/4-(y-1)/100+(y-1)/400;
    
    if(m!=1)ret+=month[m-2];
    
    ret+=d-1;
    
    if( ( (y%4==0 && y%100!=0) || y%400==0 ) && m>2 )ret++;
    
    return ret;
}


int main() {
    int y1,m1,d1,y2,m2,d2;
    while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
        if(y1==-1)break;
        cout<<solve(y2,m2,d2)-solve(y1,m1,d1)<<endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int count(int y,int m,int d){//1/1/1~y/m/d?????\??°(1/1/1=1)
	int num=0;
	if((!(y%4)&&(y%100))||(!(y%400)))month[1]=29;
	for(int i=0;i<m-1;i++){
		num+=month[i];
	}
	num+=d;
	month[1]=28;
	//printf("%d/%d/%d:%d\n",y,m,d,num);
	return num;
}
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 ans=0;
		if(y1==y2){
			ans=count(y2,m2,d2)-count(y1,m1,d1);
		}else if(y2-y1==1){
			ans=365-count(y1,m1,d1)+count(y2,m2,d2);
			if((!(y1%4)&&(y1%100))||(!(y1%400)))ans++;
		}else{
			y1++;y2--;
			ans+=(y2-y1+1)*365+(y2/4-y2/100+y2/400)-((y1-1)/4-(y1-1)/100+(y1-1)/400);
			ans+=count(++y2,m2,d2)+365-count(--y1,m1,d1);
			if((!(y1%4)&&(y1%100))||(!(y1%400)))ans++;
		}
		cout<<ans<<endl;

	}
    return 0;
}

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)+(306*(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;
}