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