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(){

  long long int y1,m1,d1,y2,m2,d2;
  long long 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 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) 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++: //10
#include<iostream>

using namespace std;

int dc(int y,int m,int d){
  int cy,cm,cd;
  cy=cm=cd=1;
  int dct=0;
  while(y!=cy||m!=cm||cd!=d){
    dct++;
    cd++;
    static const int dom[][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}};
    if(cd>dom[cy%400==0||(cy%4==0&&cy%100)][cm]){
      cd=1;
      cm++;
      if(cm>12){
	cm=1;
	cy++;
      }
    }
  }
  return dct;
}

int main(){
  for(int y,m,d,yy,mm,dd;cin>>y>>m>>d>>yy>>mm>>dd,(y|m|d|yy|mm|dd)>=0;){
    cout<<dc(yy,mm,dd)-dc(y,m,d)<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstring>
#include<ctime>
using namespace std;
int main(void){
	while( true ){
		int y1, m1, d1;
		int y2, m2, d2;
		struct tm t1, t2;
		double diff;
		time_t second1, second2;

		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if( y1 == -1 && y2 == -1 && m1 == -1 && m2 == -1 && d1 == -1 && d2 == -1 )
			break;

		memset(&t1,0,sizeof(t1));
		memset(&t2,0,sizeof(t2));
		t1.tm_year = y1 - 1900;
		t1.tm_mon = m1 - 1;
		t1.tm_mday = d1;
		t2.tm_year = y2 - 1900;
		t2.tm_mon = m2 - 1;
		t2.tm_mday = d2;

		second1 = mktime( &t1 );
		second2 = mktime( &t2 );

		diff = difftime( second2, second1 );
		
		cout << (int)(diff / (3600*24)) << '\n';
	}
	return 0;
}

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


int leap(int year){

  int cnt;

  cnt = (year - year % 4) / 4 - (year - year % 100) / 100 + (year - year % 400) / 400;

  return cnt;

}

int main(){

  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int y1, m1, d1, y2, m2, d2, day_cnt1, day_cnt2;
  
  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2){
    if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break;
  
    day_cnt1 = 365 * (y1 - 1);
    day_cnt2 = 365 * (y2 - 1);
    
    for(int i=1; i<13; i++){
      if(m1 > i) day_cnt1 += month[i];
      if(m2 > i) day_cnt2 += month[i];
      if(m1 == i) day_cnt1 += d1;
      if(m2 == i) day_cnt2 += d2;
    }
    
    if(m1 == 1 || (m1 == 2 && d1 <= 28)) day_cnt1 += leap(y1 - 1);
    else day_cnt1 += leap(y1);
    if(m2 == 1 || (m2 == 2 && d2 <= 28)) day_cnt2 += leap(y2 - 1);
    else day_cnt2 += leap(y2);
    
    cout << day_cnt2 - day_cnt1 << endl;
  }
  

  return 0;

}

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

int main() {
	int y,m,d,Y,M,D,i,b,c,yday,mday,day;
	int sum,n,uru,nuru;
	for(;;){
		
		if(y==-1||m==-1||d==-1||Y==-1||M==-1||y==-1){
			break;
		}
		
		
	
	cin>>y>>m>>d>>Y>>M>>D;
	
	
	
	
	yday=(Y-y)*365;
	mday=(M-m)*30;
	day=D-d;
	uru=(Y-y)/4;
	if(y%4==0){
		uru=uru+1;
	}
	if(2000<=y&&Y>=2100){
		uru=uru-1;
	}if(2100<=y&&Y>=2200){
		uru=uru-1;
	}if(2200<=y&&Y>=2300){
		uru=uru-1;
	}if(2300<=y&&Y>=2400){
		uru=uru-1;
	}if(2400<=y&&Y>=2500){
		uru=uru-1;
	}if(2500<=y&&Y>=2600){
		uru=uru-1;
	}if(2600<=y&&Y>=2700){
		uru=uru-1;
	}if(2800<=y&&Y>=2900){
		uru=uru-1;
	}
	
	sum=yday+mday+day+uru;
	
	if(m<=2&&2<=M&&m!=M){
		sum+=1;
	}
	if(m<=4&&4<=M&&m!=M){
		sum+=1;
	}
	if(m<=6&&6<=M&&m!=M){
		sum+=1;
	}
	if(m<=9&&9<=M&&m!=M){
		sum+=1;
	}
	if(m<=12&&12<=M&&m!=M){
		sum+=1;
	}
	
	
	if(Y%400==0&&y%400==0&&Y!=y){
		
		sum=sum+1;
	}
	
	if(sum!=0){
	printf("%d\n",sum);
	}
}
	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;
      end.back();
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;int main(){int a,b,c,d,e,f,g,h[]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=97*d/400-97*a/400;cout<<g<<endl;}}