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<bits/stdc++.h>
using namespace std;
int main()
{
    int year[2],month[2],day[2];
    while(cin>>year[0]>>month[0]>>day[0]>>year[1]>>month[1]>>day[1]){
        bool en=0;
        for(int i=0;i<2;i++)if(year[i]<0||month[i]<0||day[i]<0)en=1;
        if(en)break;
        int ans=0;
        for(int i=year[0];i<=year[1];i++){
            ans+=365;
            if(i%4==0&&i%100!=0||i%400==0)ans+=1;
        }
        ans+=day[1]-day[0]+1;
        for(int i=1;i<month[0];i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        if((year[0]%4==0&&year[0]%100!=0||year[0]%400==0)&&month[0]>=2)ans-=1;
        for(int i=month[1];i<13;i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        if((year[1]%4==0&&year[1]%100!=0||year[1]%400==0)&&month[1]<=2)ans+=1;
        cout<<ans-1<<endl;
    }
}

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

int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int lmonth[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 day1 = 0,day2 = 0;

    //day    
    day1 += d1;
    day2 += d2;

    //month
    if(y1 % 4 == 0) {
      if(y1 % 100 == 0 && y1 % 400 != 0){
	for(int i=1;i<m1;i++)
	  day1 += month[i];
      }
      else {
	for(int i=1;i<m1;i++)
	  day1 += lmonth[i];
      }
    }
    else {
      for(int i=1;i<m1;i++)
	day1 += month[i];
    } 

    if(y2 % 4 == 0) {
      if(y2 % 100 == 0 && y2 % 400 != 0){
	for(int i=1;i<m2;i++)
	  day2 += month[i];
      }
      else {
	for(int i=1;i<m2;i++)
	  day2 += lmonth[i];
      }
    }
    else {
      for(int i=1;i<m2;i++)
	day2 += month[i];
    } 
    


    //year
    for(int i=1;i<y1;i++) {
      if(i % 4 == 0) {
	if(i % 100 == 0 && i % 400 != 0){
	  day1 += 365;
	}
	else {
	  day1 += 366;
	}
      }
      else {
	day1 += 365;
      }
    }

    for(int i=1;i<y2;i++) {
      if(i % 4 == 0) {
	if(i % 100 == 0 && i % 400 != 0){
	  day2 += 365;
	}
	else {
	  day2 += 366;
	}
      }
      else {
	day2 += 365;
      }
    }
    
    cout << day2-day1 << endl;
  }
}

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;
  if(y2<y1){
	  swap(y1,y2);
	  swap(m1,m2);
	  swap(d1,d2);
  }
  else if(y2==y1){
	  if(m2<m1){
		  swap(m1,m2);
		  swap(d1,d2);
	  }
	  else if(m2==m1){
		  if(d2<d1){
			  swap(d1,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;
 }
 int lk;
 cin >> lk >> lk;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int year[2],month[2],day[2];
    while(cin>>year[0]>>month[0]>>day[0]>>year[1]>>month[1]>>day[1]){
        bool en=0;
        for(int i=0;i<2;i++)if(year[i]<0||month[i]<0||day[i]<0)en=1;
        if(en)break;
        int ans=0;
        for(int i=year[0];i<=year[1];i++){
            ans+=365;
            if(i%4==0&&i%100!=0||i%400==0)ans+=1;
        }
        if((year[0]%4==0&&year[0]%100!=0||year[0]%400==0)&&month[0]>=2)ans-=1;
        if((year[1]%4==0&&year[1]%100!=0||year[1]%400==0)&&month[1]<=2)ans+=1;
        for(int i=1;i<month[0];i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        for(int i=month[1];i<13;i++){
            if(i==2)ans-=28;
            else if(i==4||i==6||i==9||i==11)ans-=30;
            else ans-=31;
        }
        ans+=day[1]-day[0];
        cout<<ans<<endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <sstream>
#include <map>
using namespace std;
typedef long long ll;

int m[] = {
	31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};

ll ytod(int y){
	ll days = 0;
	int a = y / 4 - y / 100 + y / 400;
	return (y - a) * 365 + a * 366;
}

ll mtod(int y, int mo){
	ll day = 0;
	for(int i = 0; i < mo - 1; i++){
		day += m[i];
		if(i == 1 && (y % 4 == 0 && (y % 400 == 0 || y % 100 != 0))) day++;
	}
	return day;
}

ll get_day(int a, int b,int c){
	ll day = ytod(a - 1) + mtod(a, b) + c;
	return day;
}

int main(){
	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		if(a == -1 && b == -1 && c == -1 && d == -1 && e == -1 && f == -1) break;
		ll day1 = get_day(a, b, c);
		ll day2 = get_day(d, e, f);
		cout << day2 - day1 << endl;;
	}
	return 0;
}

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

int main(){
	int cal[100000];
	int month[13];
	month[1]=month[3]=month[5]=month[7]=month[8]=month[10]=month[12]=31;
	month[4]=month[6]=month[9]=month[11]=30;
	loop(i,0,100000){
		if(i%4==0){
			if(i%100==0){
				if(i%400==0){
					cal[i]=1;
				}else cal[i]=0;
			}else cal[i]=1;

		}else cal[i]=0;
	}
	int ay,am,ad,by,bm,bd;
	while(1){
		cin>>ay>>am>>ad>>by>>bm>>bd;
		if(ay<0 || am<0 || ad<0 || by<0 || bm<0 || bd<0)break;
		long long ans=0;
		loop(j,ay+1,by){
			if(cal[j]==1){
				ans+=366;
			}else ans+=365;
		}
		if(ay!=by){
			loop(j,am+1,13){
				if(j==2){
					if(cal[ay]=1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
			loop(j,1,bm){
				if(j==2){
					if(cal[by]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}else{
			loop(j,am+1,bm){
				if(j==2){
					if(cal[am]==1)ans+=29;
					else ans+=28;
				}else ans+=month[j];
			}
		}
		if(am!=bm){
			if(am==2){
				if(cal[ay]==1)ans+=(29-ad);
				else ans+=(28-ad);
			}else{
				ans+=(month[am]-ad);
				ans+=bd;
			}
		}else if(ay==by){
			ans+=(bd-ad);
		}else{
			if(am==2){
				if(cal[ay]==1)ans+=(29-ad);
				else ans+=(28-ad);
			}else{
				ans+=(month[am]-ad);
				ans+=bd;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}