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 <vector>
#include <algorithm>

using namespace std;


bool checkUru(const int y){
	if(y==0)
		return false;
	if(y%4==0){
		if(y%100==0){
			if(y%400==0){
				return true;
			}
			else{
				return false;
			}
		}
		else
			return true;
	}
	else
		return false;
}


const int md[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int calcDays(int y,int m,int d){
	int sum=0;
	for(int i = 0; i < y; i++){
		if(checkUru(i)){
			sum+=366;
		}
		else
			sum+=365;
	}
	for(int i = 1; i < m; i++){
		if(checkUru(i)&&m==2){
			sum+=md[i]+1;
		}
		else
			sum+=md[i];
	}
	sum+=d;
	return sum;
}

int main(){


	int y1,m1,d1,y2,m2,d2;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2&&(y1>=0&&m1>=0&&d1>=0&&y2>=0&&m2>=0&&d2>=0)){
		int sum=0;
		cout<<calcDays(y2,m2,d2)-calcDays(y1,m1,d1)<<endl;

		//if(y1!=y2){
		//	for(int y = y1+1; y < y2; y++){
		//		if(checkUru(y)){
		//			sum+=366;
		//		}
		//		else
		//			sum+=365;
		//	}
		//	// y1ツづ2ツづ可づつつ「ツづ計ツ算
		//	if(checkUru(y1)){
		//		sum+=(md[m1]-d1);
		//		if(m1==2)
		//			sum++;
		//		for(int m=m1+1; m<=12; m++){
		//			if(m==2)
		//				sum++;
		//			sum+=md[m];
		//		}
		//	}
		//	else{
		//		sum+=(md[m1]-d1);
		//		for(int m=m1+1; m<=12; m++){
		//			sum+=md[m];
		//		}
		//	}
		//	
		//	if(checkUru(y2)){
		//		sum+=(d1);

		//		for(int m=1; m<m2; m++){
		//			if(m==2)
		//				sum++;
		//			sum+=md[m];
		//		}
		//	}
		//	else{
		//		sum+=(d1);
		//		for(int m=1; m<m2; m++){
		//			sum+=md[m];
		//		}
		//	}
		//}
		//else{
		//	if(m1!=m2){
		//		for(int m=m1+1; m < m2; m++){
		//			if(checkUru(y1)&&m==2){
		//				sum+=29;
		//			}
		//			else
		//				sum+=md[m];
		//		}
		//		// m1ツづ2ツづ可づつつ「ツづ計ツ算
		//		if(checkUru(y1)&&m1==2){
		//			sum+=(md[m1]-d1)+1;
		//		}
		//		else
		//			sum+=(md[m1]-d1);

		//		// m2
		//		sum+=d2;

		//	}
		//	else{
		//		sum+=d2-d1;
		//	}
		//}
//		cout<<sum<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <sstream>


using namespace std;


int day_per_month[13] ={0,31, 28, 31, 30, 31, 30 ,31, 31, 30, 31, 30, 31};
int day_per_month_leap_year[13] ={0,31, 29, 31, 30, 31, 30 ,31, 31, 30, 31, 30, 31};

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 y,m;
        y=y1;
        int day = 0;

        
        while(1){
            if(y+1>y2)break;
            
            day+=365;
            if(y%4==0){
                day++;
                if(y%100==0){
                    day--;
                    if(y%400==0){
                        day++;
                    }
                }
            }
            y++;
            
        }
        
        if(m1<m2){
            m=m1;
            while(1){
                if(m+1>m2)break;
                double flag=false;
                if(y1%4==0){
                    flag=true;
                    if(y1%100==0){
                        flag=false;
                        if(y1%400){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    day+=day_per_month_leap_year[m];
                    m++;
                }else{
                    day+=day_per_month[m];
                    m++;
                }
            }
        }else if(m1>m2){
            m=m2;
            while(1){
                if(m-1<m1)break;
                double flag=false;
                if(y1%4==0){
                    flag=true;
                    if(y1%100==0){
                        flag=false;
                        if(y1%400){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    day-=day_per_month_leap_year[m];
                    m++;
                }else{
                    day-=day_per_month[m];
                    m++;
                }
            }
        }
        
        day+=d2-d1;
        
        cout<<day<<endl;
        
        
        
    }
}

C++: #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

int month[]={
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = y*365+d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    if ( i %100 == 0){
      if ( i %400 != 0)continue;
      else if ( i %400 == 0)base++;//,cout << i <<" " << y<<m<<d<<endl;
    }else if ( i%4 == 0 )base++;//,cout << i << " " <<y<<m<<d<<endl;
  }
  return base;
}


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 a=day(y1,m1,d1),b=day(y2,m2,d2);
    cout << b-a << endl;
  }
}