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 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+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}}

C++: #include <bits/stdc++.h>
using namespace std;
  
// #define int long long
#define pb push_back
#define REP(i, n) for (int i = 0; i < (n); i++)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;

bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}
template <class X> void print(X Target){ cout << Target << '\n'; }

ll Day_cnt(int y, int m, int d)
{
  int mon[] = {0, 31, is_uruu(y) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  ll res = d;

  REP(i, m - 1){
    res += mon[i + 1];
  }
  REP(i, y - 1){
    is_uruu(i + 1) ? res += 366 : res += 365;
  }

  return (res);
}

signed main()
{
  ios::sync_with_stdio(false);
  int y1, m1, d1, y2, m2, d2;

  while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2, y1 != -1 && m1 != -1 && d1 != -1 && y2 != -1 && m2 != -1 && d2 != -1){
    print(Day_cnt(y2, m2, d2) - Day_cnt(y1, m1, d1));
  }
  
  return (0);
}

C++: import java.util.Scanner;

class Main{
	public static void main(String[] args){

		int[] dayday = new int[6];
		int di;
		boolean flag = false;
		Scanner input = new Scanner(System.in);
		
		while(true){
			di = 0;
			for(int i = 0; i < 6; i++){
				dayday[i] = input.nextInt();
				if (dayday[i] < 0){
					flag = true;
				}
			}
			if(flag) break;
			
			Day day = new Day(dayday[0], dayday[1], dayday[2]);
			day.Day2(dayday[3], dayday[4], dayday[5]);
			
			di += day.year_d();
			di += day.month_d();
			di += day.d_d();
			System.out.println(di);
		}
	}
}

class Day{
	private int year;
	private int month;
	private int date;
	private int year2;
	private int month2;
	private int date2;
	private int uru  = 0;
	
	public Day(int year, int month, int date){
		this.year = year;
		this.month = month;
		this.date = date;
	}
	public void Day2(int year, int month, int date){
		this.year2 = year;
		this.month2 = month;
		this.date2 = date;
	}
	public void printday(){
		System.out.println("year = " + this.year);
		System.out.println("month = " + this.month);
		System.out.println("date = " + this.date);
		System.out.println("year2 = " + this.year2);
		System.out.println("month2 = " + this.month2);
		System.out.println("date2 = " + this.date2);
	}
	public int year_d(){
		for (int i = this.year; i < this.year2; i++){
			if (i%4 == 0 && !(i%100 == 0) || i%400 == 0){
				this.uru++;
			}
		}
		return (this.year2 - this.year) * 365 + uru;
	}
	public int month_d(){
		int sum = 0;
		int sum2 = 0;
		for (int i = 1; i < this.month; i++){
			if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){
				sum += 31;
			}
			else if(i == 2) {
				sum += 28;
				if(uru > 0){
					sum--;
				}
			}
			else{
				sum += 30;
			}
		}
		
		for (int i = 1; i < this.month2; i++){
			if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){
				sum2 += 31;
			}
			else if(i == 2) {
				sum2 += 28;
				if(uru > 0){
					sum2--;
				}
			}
			else{
				sum2 += 30;
			}
		}
		
		return sum2 - sum;
	}
	
	public int d_d(){
		this.date2 -= this.date;
		
		return date2;
	}
}

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

static const int days_month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool isLeap(int year) {
	if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
		return true;
	return false;
}

int main() {
	while(1) {
		int y1, m1, d1, y2, m2, d2;
		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;

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

		int accume = 0;
		for(int year = y1; year <= y2; year++) {
			if(isLeap(year))
				accume += 366;
			else
				accume += 365;
		}
		for(int month = 0; month < m1 - 1; month++) {
			accume -= days_month[month];
			if(month == 1 && isLeap(y1))
				accume--;
		}
		for(int month = m2; month < 12; month++) {
			accume -= days_month[month];
			if(month == 1 && isLeap(y2))
				accume--;
		}
		for(int day = 1; day < d1; day++) {
			accume--;
		}
		for(int day = d2; day <= days_month[m2 - 1] + (m2 == 2 && isLeap(y2) ? 1 : 0); day++) {
			accume--;
		}

		cout << accume << endl;
	}
	return 0;
}

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

int main(){
  int i,j,y[2],m[2],d[2],ans,f;
  while(1){
    f = 0;
    for(i=0;i<2;i++){
      cin >> y[i] >> m[i] >> d[i];
      if(y[i] == -1 || m[i] == -1 || d[i] == -1) f++;
    }
    if(f != 0) break;

    ans = (y[1] - y[0]) * 365 + (m[1] - m[0]) * 30 + d[1] - d[0];

    for(i=m[0];i<=m[1];i++){
      if((i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) && i != m[1]) ans++;
    }

    for(i=y[0];i<=y[1];i++){
      if(i%4 == 0 && (i != y[1] || m[i] > 2)){
	if(i%400 == 0);
	else if(i%100 == 0) continue;
	ans++;
      }
    }

    cout << ans << endl;

  }
  return 0;
}

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