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>
#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>
using namespace std;


int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int calc(int y,int m,int d){
	int res=d-1;
	if(2<m && y%4==0&&(y%100||y%400==0))res++;
	for(int i=0;i<m-1;i++)res+=days[i];
	y--;
	res+=y/400*146097;
	y%=400;
	res+=y/100*36524;
	y%=100;
	res+=y/4*1461;
	y%=4;
	res+=y*365;
	return res;
}

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;
		cout<<calc(y2,m2,d2)-calc(y1,m1,d1)<<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+=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;
}