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

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

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

int main()
{
	int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	int days_leap[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
	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 sum = 0;

		if(y2 - y1 == 0)
		{
			if(m2 - m1 == 0)
			{
				sum += d2 - d1;
			}
			else
			{
				if(leap(y1))
				{
					sum += days_leap[m1] - d1;
					REP(i,m1+1,m2)
					{
						sum += days_leap[i];
					}

					cout << sum << endl;
					sum += d2;

					cout << sum << endl;
				}
				else
				{
					sum += days[m1] - d1;

					REP(i,m1+1,m2)
					{
						sum += days[i];
					}

					sum += d2;
				}
			}
		}
		else
		{
			if(leap(y1))
			{
				sum += days_leap[m1] - d1;
				
				REP(i,m1+1,13)
				{
					sum += days_leap[i];
				}

			}

			else
			{
				REP(i,1,m1)
				{
					sum += days[i];
				}
		
				sum += days[m1] - d1;

				REP(i,m1+1,13)
				{
					sum += days[i];
				}
			
			}

			REP(i,y1+1,y2)
			{
				if(leap(i))
				{
					sum += 366;
				}
				else
				{
					sum += 365;
				}
			}

			if(leap(y2))
			{
				REP(i,1,m2)
				{
					sum += days_leap[i];
				}
				sum += d2;
			}
			else
			{
				REP(i,1,m2)
				{
					sum += days[i];
				}
				sum += d2;
			}

		}

		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(y2%4==0){
                    flag=true;
                    if(y2%100==0){
                        flag=false;
                        if(y2%400==0){
                            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(y2%4==0){
                    flag=true;
                    if(y2%100==0){
                        flag=false;
                        if(y2%400==0){
                            flag=true;
                        }
                    }
                }
                
                if(flag){
                    m--;
                    day-=day_per_month_leap_year[m];
                }else{
                    m--;
                    day-=day_per_month[m];
                }
            }
        }
        //cout<<day<<endl;
        
        day+=d2-d1;
        
        cout<<day<<endl;
        
        
        
    }
}

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