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<stdio.h>
int main(void){
	int y1,m1,d1,y2,m2,d2;
	int i;
	int y1day,y2day;
	while(1){
		scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
		y1day=y2day=0;
		if(y1==-1 || m1==-1 || d1==-1 || y2==-1 || m2==-1  || d2==-1) break;
		y1day=y2day=0;
		for(i=1;i<y1;i++){
			y1day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y1day++;
		}
		for(i=1;i<m1;i++){
			y1day+=31;
			if(i==4 || i==6 || i==9 || i==11) y1day-=1;
			if(i==2){
				y1day-=3;
				if((y1%4==0 && y1%100!=0) || y1%400==0) y1day++;
			}
		}
		y1day+=d1;
		for(i=1;i<y2;i++){
			y2day+=365;
			if((i%4==0 && i%100!=0) || i%400==0) y2day++;
		}
		for(i=1;i<m2;i++)	{
			y2day+=31;
			if(i==4 || i==6 || i==9 || i==11) y2day--;
			if(i==2){
				y2day-=3;
				if((y2%4==0 && y2%100!=0) || y2%400==0) y2day++;
			}
	//		printf("y2d==%d\n",y2day);
		}
		y2day+=d2;
	//	printf("%d %d\n",y1day,y2day);
		printf("%d\n",y2day-y1day);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int i,year1,year2,month1,month2,day1,day2,someday=0;
    int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

    while(1){
        cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2;
        if(year1 == -1 || year2 == -1 || month1 ==-1 || month2 == -1 || day1 == -1 || day2==-1){
            break;
        }

        someday=0;

        if(year1 % 4 == 0 || year2 % 4 == 0){
            if(year1 % 100 == 0 || year2 % 100 == 0){
                if(year1 % 400 == 0 || year2 % 400 == 0){
                    someday += ((year2 - year1) * 365 + 1 + (year2 - year1) / 4);
                }
                else {
                    someday += ((year2 - year1) * 365 + (year2 - year1) / 4);
                }
            }
            else {
                someday += ((year2 - year1) * 365 + 1 + (year2 - year1) / 4);
            }
        }
        else{
            someday += ((year2 - year1) * 365 + (year2 - year1) / 4);
        }

        if(year2 > year1 && month2 < month1){
            if(year1 % 4 == 0 || year2 % 4 == 0){
                if(year1 % 100 == 0 || year2 % 100 == 0){
                    if(year1 % 400 == 0 || year2 % 400 == 0){
                        someday -= 366;
                    }
                    else {
                        someday -= 365;
                    }
                }
                else {
                    someday -= 366;
                }
            }
            else{
                someday -= 365;
            }
            
        }
        
        if(month1 == month2){
            someday += day2 - day1;  
        }
        else if(month1 < month2){
            for(i=1;i<month2 - month1;i++){
                someday += month[month1 + i];
            }
            someday += month[month1] - day1 + day2;
        }
        else {
            for(i=1;i<month2 - month1 + 12;i++){
                if(month1 + i > 12){
                    someday += month[month1 + i -12];
                }
                else {
                    someday += month[month1 + i];
                }
            }
             someday += month[month1] - day1 + day2;
        }

        if(year2 - year1 >= 4){
            someday -= 1;
        }

        cout << someday << endl;
        
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int conpute( int y,int m, int d ){

  int day = 0;

  for( int i = 1 ; i < y ; i++ ){
    day += 365;
    if( i % 100 == 0 ){
      if( i % 400 == 0 ) day++;
    }
    else if( i % 4 == 0 ) day++;
  }
  
for( int i = 1 ; i <  m ; i++ ){

    switch(i){
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
      day += 31;
      break;
    case 2:
      day += 28;
      if( y % 100 == 0 ){
	if( y % 400 == 0 ) day++;
      }
      else if( y % 4 == 0 ) day++;
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      day += 30;
      break;
    }
 }
 day += d;
 return day;
}
int main(void){
  
  int y1,y2;
  int m1,m2;
  int d1,d2;
  
  while( cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 ){
    if( y1 == m1 && m1 == d1 && d1 == y2 && y2 == m2 && m2 == d2 && d2 == -1 ){
      break;
    }
    int ans = 0;
    ans = conpute( y2, m2, d2 ) - conpute( y1, m1, d1 );
    cout << ans << endl;
  }
  return 0;
}

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

bool isleap(int y) {
    if(y%4 != 0) return false;
    if(y%400 == 0) return true;
    return y%100 != 0;
}

int dc(int y,int m,int d) {
    int res = 0;
    for(int i=1; i<y; ++i) res += 365 + isleap(i);
    for(int i=1; i<m; ++i) {
        res += 31;
        if(i == 4 || i == 6 || i == 9 || i == 11) res--;
        if(i == 2) res -= 3 + isleap(y);
    }
    res += d;
    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;

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
bool leap(int Y){
  if(Y%4==0)
    return( (Y%100==0)?( (Y%400==0)?true:false ):true ); 
  else return false;
}
int days(int Y,int M){
  if(M==2){
    if( leap(Y) ) return 29;
    else return 28;
  }
  else if(M==4 || M==6 || M==9 || M==11) return 30;
  else return 31;
}
int main(){
  int Y,M,D,aY,aM,aD;
  int cont=0;
  while(cin>>Y>>M>>D>>aY>>aM>>aD){
    if(Y<0 || M<0 || D<0 || aY<0 || aM<0 || aD<0) break;
    for(;;){
      if(Y==aY && M==aM && D==aD) break;
      D += 1;
      if(D > days(Y,M) ){
	D = 1;
	M += 1;
      }
      if(M > 12){
	M = 1;
	Y += 1;
      }
      cont++;
	}
    cout<<cont<<endl;
    cont = 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<0 || b<0 || c<0||d<0||e<0||f<0)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;
	}
}