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<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
	int x=28;
	int W=365;
	int cal[13]={0,31,x,31,30,31,30,31,31,30,31,30,31};
	int cal2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int y1,m1,d1,y2,m2,d2;
	bool F=false;
	while(1){F=false;
		int ans=0;
		cin>>y1>>m1>>d1>>y2>>m2>>d2;if(y1==-1)break;
		if(y1!=y2){
			if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;

			if(F==false)cal[2]=28;
			else cal[2]=29;
			ans+=cal[m1]-d1+1;
			//cout<<ans<<endl;
			for(int i=m1+1;i<=12;i++)
			{ans+=cal[i];
			//cout<<ans<<endl;
			}
			d1=1;m1=1;y1++;
			//cout<<ans<<endl;
		}
		while(y1!=y2){F=false;
				if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;
			if(F==false)W=365;
			else  W=366;
			ans+=W;
			y1++;
			//cout<<ans<<endl;
		}
		while(m1!=m2){
			for(int i=m1;i<m2;i++)
				ans+=cal[i];
			m1=m2;
		}
		ans+=d2-d1;
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  long long y1,y2,m1,m2,d1,d2,ans=0,mon,day;
  int noturuu[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},uruu[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
  bool f=true;
  while(cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2){
    if(y1<0 or m1<0 or d1<0 or y2<0 or m2<0 or d2<0){
      break;
    }
    ans=0;
    mon=m1;
    day=d1;
    for(int i=y1;i<=y2;i++){
      f=true;
      if(i%4==0){
        if(i%100==0){
          if(i%400==0){
            f=true;
          }else{
            f=false;
          }
        }else{
          f=true;
        }
      }else{
        f=false;
      }
      if(f){//うるう
        for(int j=mon;j<=12;j++){
          if(y2==i and m2==j){
            ans+=d2-day;
            break;
          }
          if(y1==i and m1==j){
            ans+=uruu[j]-day+1;
          }else{
            ans+=uruu[j];
          }
          day=1;
        }
      }else{//notうるう
        for(int j=mon;j<=12;j++){
          if(y2==i and m2==j){
            ans+=d2-day;
            break;
          }
          if(y1==i and m1==j){
            ans+=noturuu[j]-day+1;
          }else{
            ans+=noturuu[j];
          }
          day=1;
        }
      }
      mon=1;
    }
    cout << ans << endl;
  }
  return 0;
}

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

int cnt=0;

#define A 0
#define O 1
#define X 2

class state{
public:
  int num[(1<<4)];
  
};
const int lim = ( 1 << 4);
int table[8][(1<<4)];
int data[8];

state parse(string &in,int &p){
  state ret;
  rep(i,lim)ret.num[i]=0;
  if ( in[p]== '('){
    p++;
    state left = parse(in,p);
    p++;//space
    state right =parse(in,p);
    p++;


    rep(i,lim){
      rep(j,lim){
	int val1=i&j,val2=i|j,val3=i^j;

	int add=left.num[i]*right.num[j];
	ret.num[val1]+=add;
	ret.num[val2]+=add;
	ret.num[val3]+=add;
      }
    }
  }else if ( in[p] <='9' && in[p] >='0'){
    int now = in[p]-'0';
    now--;
    ret.num[data[now]]=1;
    p++;
  }
  return ret;
}


main(){
  string t;
  while(getline(cin,t) && t != "END"){
    int n;
    cin>>n;
    
    int num=0;
    int p=0;
    rep(i,n){
      data[i]=0;
      int kari;
      rep(j,4)cin>>kari,data[i]|=(kari<<j);
    }
    
    state ans = parse(t,p);
    cout << ans.num[(1<<4)-1]<<endl;
    getline(cin,t);
  }
  return false;
}

C++: #include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
	int x=28;
	int W=365;
	int cal[13]={0,31,x,31,30,31,30,31,31,30,31,30,31};
	int cal2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int y1,m1,d1,y2,m2,d2;
	bool F=false;
	while(1){F=false;
		int ans=0;
		cin>>y1>>m1>>d1>>y2>>m2>>d2;if(y1<0||m1<0||d1<0||y2<0||m2<0||d2<0)break;
		if(y1!=y2){
			if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;

			if(F==false)cal[2]=28;
			else cal[2]=29;
			ans+=cal[m1]-d1+1;
			//cout<<ans<<endl;
			for(int i=m1+1;i<=12;i++)
			{ans+=cal[i];
			//cout<<ans<<endl;
			}
			d1=1;m1=1;y1++;
			//cout<<ans<<endl;
		}
		while(y1!=y2){F=false;
				if(y1%4==0)F=true;
			if(y1%100==0)F=false;
			if(y1%400==0)F=true;
			if(F==false)W=365;
			else  W=366;
			ans+=W;
			y1++;
			//cout<<ans<<endl;
		}
		while(m1!=m2){
			for(int i=m1;i<m2;i++)
				ans+=cal[i];
			m1=m2;
		}
		ans+=d2-d1;
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int leapyear(int year)
{
  if(year%4)
    return 0;
  if(year%100==0){
    if(year%400==0)
      return 1;
    else 
      return 0;
  }else 
    return 1;
}

int main()
{
  int y1,m1,d1,y2,m2,d2;
  int i,j,k;
  int day[2][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}};

  while(1){
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    if(y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0)break;
    int days=0;

    if(y1==y2){

      if(m1==m2)
	days=d2-d1;
      else{
	days=day[leapyear(y1)][m1]-d1;
	for(i=m1+1;i<m2;i++)
	  days+=day[leapyear(y1)][i];
	days+=m2;
      }

    }else{

      days=day[leapyear(y1)][m1]-d1;
      for(i=m1+1;i<=12;i++)
	days+=day[leapyear(y1)][i];
      for(i=y1+1;i<y2;i++)
	days+=365+leapyear(i);
      for(i=1;i<m2;i++)
	days+=day[leapyear(y2)][i];
      days+=d2;

    }
    cout<<days<<endl;

  }
}