semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//****************************************
//*??? 
//*????? 1100012996       *
//*???2011.10.26**
//****************************************
int main()
{
	int sy, sm, sd, ey, em, ed,len = 0;
	cin >> sy >> sm >> sd >> ey >> em >> ed;
	int i;
	int month[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}};
	int run = 0;
	if ( sy != ey)
	{
	run = (sy % 4 == 0 && sy % 100 != 0 || sy % 400 == 0) ? 1 : 0;
	for (i = sm; i <= 12; i++)
	{
		len += month[run][i];
	}
	for (i = sy + 1; i < ey; i++)
	{
		run = (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) ? 1 : 0;
		len +=(365 + run);
	}
	run = (ey % 4 == 0 && ey % 100 != 0 || ey % 400 == 0) ? 1 : 0;
	for (i = 1; i < em; i++)
	{
		len += month[run][i];
	}
	}
	else
	{
		run = (sy % 4 == 0 && sy % 100 != 0 || sy % 400 == 0) ? 1 : 0;
	for (i = sm; i < em; i++)
	{
		len += month[run][i];
	}
	}
		
	len = len - sd + ed;
	cout << len <<endl;
	return 0;
}
void main()
{
	int a,b,c,d,e,f,x,y,z,r,s;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);a=a-1;
	x=366*(a/4-a/100+a/400-1)+365*(a-(a/4-a/100+a/400)+1);a=a+1;
	if((a%4==0&&a%100!=0)||(a%400==0))
	{
		switch(b)
		{
		case 1:y=0;break;
		case 2:y=31;break;
		case 3:y=31+29;break;
		case 4:y=31+29+31;break;
		case 5:y=31+29+31+30;break;
	    case 6:y=31+29+31+30+31;break;
		case 7:y=31*3+29+30*2;break;
		case 8:y=31*4+29+30*2;break;
		case 9:y=31*5+29+30*2;break;
	    case 10:y=31*5+29+30*3;break;
		case 11:y=31*6+29+30*3;break;
		default:y=31*6+29+30*4;
		}
	}
	else
	{
		switch(b)
		{
		case 1:y=0;break;
		case 2:y=31;break;
		case 3:y=31+28;break;
		case 4:y=31+28+31;break;
		case 5:y=31+28+31+30;break;
	    case 6:y=31+28+31+30+31;break;
		case 7:y=31*3+28+30*2;break;
		case 8:y=31*4+28+30*2;break;
		case 9:y=31*5+28+30*2;break;
	    case 10:y=31*5+28+30*3;break;
		case 11:y=31*6+28+30*3;break;
		default:y=31*6+28+30*4;
		}
	}
	z=x+y+c;d=d-1;
	x=366*(d/4-d/100+d/400-1)+365*(d-(d/4-d/100+d/400)+1);d=d+1;
	if((d%4==0&&d%100!=0)||(d%400==0))
	{
		switch(e)
		{
		case 1:y=0;break;
		case 2:y=31;break;
		case 3:y=31+29;break;
		case 4:y=31+29+31;break;
		case 5:y=31+29+31+30;break;
	    case 6:y=31+29+31+30+31;break;
		case 7:y=31*3+29+30*2;break;
		case 8:y=31*4+29+30*2;break;
		case 9:y=31*5+29+30*2;break;
	    case 10:y=31*5+29+30*3;break;
		case 11:y=31*6+29+30*3;break;
		default:y=31*6+29+30*4;
		}
	}
	else
	{
		switch(e)
		{
		case 1:y=0;break;
		case 2:y=31;break;
		case 3:y=31+28;break;
		case 4:y=31+28+31;break;
		case 5:y=31+28+31+30;break;
	    case 6:y=31+28+31+30+31;break;
		case 7:y=31*3+28+30*2;break;
		case 8:y=31*4+28+30*2;break;
		case 9:y=31*5+28+30*2;break;
	    case 10:y=31*5+28+30*3;break;
		case 11:y=31*6+28+30*3;break;
		default:y=31*6+28+30*4;
		}
	}
	r=x+y+f;
	s=r-z;printf("%d",s);
}
int main()
{
	int startYear,startMonth,startDay,endYear,endMonth,endDay;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int b[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
    int i,dertYear=0,dertMonth=0,dertDay=0,sum=0;
	scanf("%d%d%d%d%d%d",&startYear,&startMonth,&startDay,&endYear,&endMonth,&endDay);
	if(startDay<endDay)
	{
		for(i=startDay;i<endDay;i++)
			dertDay=dertDay+1;
	}
	else if(startDay>endDay)
	{
		for(i=startDay;i>endDay;i--)
			dertDay=dertDay-1;
	}
	if(startMonth<endMonth)
	{
		if(endYear%4==0&&endYear%100!=0||endYear%400==0)
		{
			for(i=startMonth;i<endMonth;i++)
				dertMonth=dertMonth+b[i];
		}
		else
		{
			for(i=startMonth;i<endMonth;i++)
				dertMonth=dertMonth+a[i];
		}
	}
	else if(startMonth>endMonth)
	{
		if(endYear%4==0&&endYear%100!=0||endYear%400==0)
		{
			for(i=startMonth;i>endMonth;i--)
				dertMonth=dertMonth-b[i];
		}
		else
		{
			for(i=startMonth;i>endMonth;i--)
				dertMonth=dertMonth-a[i];
		}
	}
	if(startYear<endYear)
	{
		for(i=startYear;i<endYear;i++)
		{
			if((i%4==0&&i%100!=0||i%400==0))
				dertYear=dertYear+366;
			else
				dertYear=dertYear+365;
		}
	}
	sum=dertDay+dertMonth+dertYear;
	printf("%d\n",sum);
	return 0;
}
int i;
	int num(int year,int month,int day){
		int n=day;
		for(i=1;i<month;i++){
			if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
				n+=31;
			else if(i==4||i==6||i==9||i==11)
				n+=30;
			else if(i==2)
				if((year%4==0&&year%100!=0)||(year%400==0))
					n+=29;
				else n+=28;
		}
		for(i=1;i<year;i++){
			if((i%4==0&&i%100!=0)||(i%400==0))
				n+=366;
			else n+=365;
		}
		return n;
	}
int main(){
	int sy,sm,sd,ey,em,ed,m;
	scanf("%d%d%d%d%d%d",&sy,&sm,&sd,&ey,&em,&ed);
	m=num(ey,em,ed)-num(sy,sm,sd);
	printf("%d",m);
	return 0;
}
//??????????????
//?????startyear?????????????endyear
//?????11.4
//????wayne
int main()
{
	int syear,smonth,sday,eyear,emonth,eday,i;
	int sum=0;
	cin>>syear>>smonth>>sday
		>>eyear>>emonth>>eday;
	if (smonth>2)                               //??2??????????
	{
		switch (smonth)
		{
		case 3:  sum=sum+31+30+31+30+31+31+30+31+30+31-sday;break;
		case 4:  sum=sum+31+30+31+30+31+31+30+31+30-sday;break;
		case 5:  sum=sum+31+30+31+30+31+31+30+31-sday;break;
		case 6:  sum=sum+31+30+31+30+31+31+30-sday;break;
		case 7:  sum=sum+31+30+31+30+31+31-sday;break;
		case 8:  sum=sum+31+30+31+30+31-sday;break;
		case 9:  sum=sum+31+30+31+30-sday;break;
		case 10: sum=sum+31+30+31-sday;break;
		case 11: sum=sum+31+30-sday;break;
		case 12: sum=sum+31-sday;            //????break????????
		}
	}
	else if ((syear%4==0&&syear%100!=0)||(syear%400==0))    //???????????????
	{
        switch (smonth)
		{
		case 1: sum=sum+31+30+31+30+31+31+30+31+30+31+29+31-sday;break;
		case 2: sum=sum+31+30+31+30+31+31+30+31+30+31+29-sday;
		}
	}
	else 
	{
        switch (smonth)
		{
		case 1: sum=sum+31+30+31+30+31+31+30+31+30+31+28+31-sday;break;
		case 2: sum=sum+31+30+31+30+31+31+30+31+30+31+28-sday;
		}
	}
	for (i=syear+1;i<=eyear-1;i++)             //????????????????????365??366
	{
		if ((i%4==0&&i%100!=0)||(i%400==0))
			sum=sum+366;
		else 
			sum=sum+365;
	}
	if (emonth==1)
	{
		sum=sum+eday;
	}
	else if (emonth==2)                   //ednyear???????????????
	{
		sum=sum+31+eday;
	}
	else if ((eyear%4==0&&eyear%100!=0)||(eyear%400==0))
	{
	    switch (emonth)
		{
		case 12: sum=sum+31+29+31+30+31+30+31+31+30+31+30+eday;break;
		case 11: sum=sum+31+29+31+30+31+30+31+31+30+31+eday;break;
		case 10: sum=sum+31+29+31+30+31+30+31+31+30+eday;break;
		case 9:  sum=sum+31+29+31+30+31+30+31+31+eday;break;
		case 8:  sum=sum+31+29+31+30+31+30+31+eday;break;
		case 7:  sum=sum+31+29+31+30+31+30+eday;break;
		case 6:  sum=sum+31+29+31+30+31+eday;break;
		case 5:  sum=sum+31+29+31+30+eday;break;
		case 4:  sum=sum+31+29+31+sday;break;
		case 3:  sum=sum+31+29+sday;
		}
	}
	else 
	{
        switch (emonth)
		{
		case 12: sum=sum+31+28+31+30+31+30+31+31+30+31+30+eday;break;
		case 11: sum=sum+31+28+31+30+31+30+31+31+30+31+eday;break;
		case 10: sum=sum+31+28+31+30+31+30+31+31+30+eday;break;
		case 9:  sum=sum+31+28+31+30+31+30+31+31+eday;break;
		case 8:  sum=sum+31+28+31+30+31+30+31+eday;break;
		case 7:  sum=sum+31+28+31+30+31+30+eday;break;
		case 6:  sum=sum+31+28+31+30+31+eday;break;
		case 5:  sum=sum+31+28+31+30+eday;break;
		case 4:  sum=sum+31+28+31+eday;break;
		case 3:  sum=sum+31+28+eday;
		}
	}
	if (syear==eyear)                  //????????????????????
	{
		if ((eyear%4==0&&eyear%100!=0)||(eyear%400==0))
			sum=sum-366;
		else 
			sum=sum-365;
	}              
	cout<<sum<<endl;
	return 0;
}
/*
 * ???:1104-4.cpp
 * ?????
 * ????: 2011-11-4
 * ??????????????????
 */
int main(){
	int sy,sm,sd,ey,em,ed,l1=0,l2=0,l;//????????????
	int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};//??????????
	int b[]={0,31,29,31,30,31,30,31,31,30,31,30,31};//??????????
	int i;//??????
	cin>>sy>>sm>>sd>>ey>>em>>ed;//??????
	for(i=1;i<sy;i++){
		if((i%4==0&&i%100!=0)||(i%400==0))
			l1+=366;
		else
			l1+=365;
	}//??????????
	for(i=1;i<sm;i++){
		if((sy%4==0&&sy%100!=0)||(sy%400==0))
			l1+=b[i];
		else
			l1+=a[i];//??????????
	}
	l1+=sd;//?????????


	for(i=1;i<ey;i++){
			if((i%4==0&&i%100!=0)||(i%400==0))
				l2+=366;
			else
				l2+=365;//??????????
		}

		for(i=1;i<em;i++){
			if((ey%4==0&&ey%100!=0)||(ey%400==0))
				l2+=b[i];
			else
				l2+=a[i];//??????????
		}
		l2+=ed;//?????????




		l=l2-l1;//????????
		cout<<l;//????
		return 0;//????


}
/*****************8??????????? *****************
??
???????????????.
??2010-1-1?2010-1-3 ???2??
year=1,2,...,3000.
???
????(year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)?
???2???29??
????
???
startYear startMonth startDay
???
endYear endMonth endDay
????
????????????????
????
2008 1 1
2009 1 1
????
366
**********************************************************
proframmer Qiu HEzi
version 1.0
cret date 2012.12.27
**********************************************************/
int main()
{
	int startYear , startMonth , startDay ;
	int endYear , endMonth , endDay;
	//?? ?         1    2   3  4  5  6  7  8  9 10 11 12
	int nmonth[13]={0,31 ,28 ,31,30,31,30,31,31,30,31,30,31};
	int rmonth[13]={0,31 ,29 ,31,30,31,30,31,31,30,31,30,31};
	cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
	int sum=0;
	for(int year=startYear ; year<endYear ; year++)
		if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			sum+=366;
		else
			sum+=365;
	if ((startYear % 4 == 0 && startYear% 100 != 0) || (startYear % 400 == 0))
	{
		for (int i=1 ; i<startMonth ; i++)
			sum-=rmonth[i];
		sum-=startDay;
	}
	else
	{
		for (int i=1 ; i<startMonth ; i++)
			sum-=nmonth[i];
		sum-=startDay;
	}
	if ((endYear % 4 == 0 && endYear% 100 != 0) || (endYear % 400 == 0))
	{
		for (int i=1 ; i<endMonth ; i++)
			sum+=rmonth[i];
		sum+=endDay;
	}
	else
	{
		for (int i=1 ; i<endMonth ; i++)
			sum+=nmonth[i];
		sum+=endDay;
	}
	cout<<sum;
	return 0;
}
int main()
{
	int all(int,int,int);
	int year1,year2,month1,month2,date1,date2;
	scanf("%d%d%d",&year1,&month1,&date1);
    scanf("%d%d%d",&year2,&month2,&date2);
	printf("%d\n",all(year2,month2,date2)-all(year1,month1,date1));
	return 0;
}
int all(int year,int month,int date)
{
	int zong=0,a[3000],b[12],i,j,k;
	for(i=0;i<year-1;i++)
	{
		if((i+1)%4==0&&(i+1)%100!=0||((i+1)%400==0))
			a[i]=366;
		else a[i]=365;
		zong=zong+a[i];
	}
	if(year%4==0&&year%100!=0||year%400==0)
			b[1]=29;
		else b[1]=28;
	for(j=0;j<month-1;j++)
	{
		if((j+1)==1||(j+1)==3||(j+1)==5||(j+1)==7||(j+1)==8||(j+1)==10||(j+1)==12)
			b[j]=31;
     	if((j+1)==4||(j+1)==6||(j+1)==9||(j+1)==11)
			b[j]=30;
	}
	for(k=0;k<month-1;k++)
		zong=zong+b[k];
	zong=zong+date;
	return zong;
}
void main()
{
	int sty,std,ey,ed,dy,ry,m,m1,stm,em;                                                 
	scanf("%d%d%d%d%d%d",&sty,&stm,&std,&ey,&em,&ed);
    ry=0;
	dy=sty;
	while(dy<ey)
	{
		if((dy% 4 == 0 && dy% 100 != 0) || (dy% 400 == 0))
			ry=ry+1;
		dy++;
	}
	if((sty% 4 == 0 && sty% 100 != 0) || (sty% 400 == 0))
	{
		if (stm==1)
			m=0;
		else if (stm==2)
			m=31;
		else if (stm==3)
			m=60;
		else if (stm==4)
			m=91;
		else if (stm==5)
			m=121;
		else if (stm==6)
			m=152;
		else if (stm==7)
			m=182;
		else if (stm==8)
			m=213;
		else if (stm==9)
			m=244;
		else if (stm==10)
			m=274;
		else if (stm==11)
			m=305;
		else if (stm==12)
			m=335;
		else
			printf("error");	
	}
	else
	{	
		if (stm==1)
			m=0;
		else if (stm==2)
			m=31;
		else if (stm==3)
			m=59;
		else if (stm==4)
			m=90;
		else if (stm==5)
			m=120;
		else if (stm==6)
			m=151;
		else if (stm==7)
			m=181;
		else if (stm==8)
			m=212;
		else if (stm==9)
			m=243;
		else if (stm==10)
			m=273;
		else if (stm==11)
			m=304;
		else if (stm==12)
			m=334;
		else
			printf("error");	
	}
	if((ey% 4 == 0 && ey% 100 != 0) || (ey% 400 == 0))
	{
		if (em==1)
			m1=0;
		else if (em==2)
			m1=31;
		else if (em==3)
			m1=60;
		else if (em==4)
			m1=91;
		else if(em==5)
			m1=121;
		else if (em==6)
			m1=152;
		else if (em==7)
			m1=182;
		else if (em==8)
			m1=213;
		else if (em==9)
			m1=244;
		else if (em==10)
			m1=274;
		else if (em==11)
			m1=305;
		else if (em==12)
			m1=335;
		else
			printf("error");
	}
	else
	{
		if (em==1)
			m1=0;
		else if (em==2)
			m1=31;
		else if (em==3)
			m1=59;
		else if (em==4)
			m1=90;
		else if (em==5)
			m1=120;
		else if (em==6)
			m1=151;
		else if(em==7)
			m1=181;
		else if (em==8)
			m1=212;
		else if (em==9)
			m1=243;
		else if (em==10)
			m1=273;
		else if (em==11)
			m1=304;
		else if(em==12)
			m1=334;
		else 
			printf("error");	
	}
	int d=ry*366+(ey-sty-ry)*365+m1-m+ed-std;
		printf("%d\n",d);
}
int leapy(int n)
{
	if((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))
		return 1;
	else
		return 0;
}
int main()
{
	int sy,sm,sd,ey,em,ed,s=0,t;
	cin>>sy>>sm>>sd>>ey>>em>>ed;
	int month[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};
	int year[2]={365,366};
	if(sy==ey)
	{
		for(int i=sm;i<=em;i++)
			s=s+month[leapy(sy)][i];
		s=s-sd+1-(month[leapy(sy)][em]-ed);
	}
	else
	{
	for(int i=sm+1;i<=12;i++)
		s=s+month[leapy(sy)][i];
	s=s+month[leapy(sy)][sm]-sd+1;
	for(int i=1;i<em;i++)
		s=s+month[leapy(ey)][i];
	s=s+ed;
	if(ey-sy>1)
	{
	for(int i=sy+1;i<=ey-1;i++)
		s=s+year[leapy(i)];
	}
	}
	cout<<s-1;
	
	return 0;
}
int main()
{
	int i,j,k;
	int a[2][3];
	int f=0,g=0,h=0,x=0;
	for(i=0;i<2;i++)
	{
		for(j=0;j<3;j++)
	{
			scanf("%d",&a[i][j]);
	}
	}
	for(k=a[0][0];k<a[1][0];k++)
	{
		if(k%400==0)
		{
			x=x+366;
		}
		else if(k%100==0)
		{
			x=x+365;
		}
		else if(k%4==0)
		{
			x=x+366;
		}
		else
		{
			x=x+365;
		}
	}
	if(a[0][0]%4!=0)
	{
	if(a[0][1]==1)
		{
			f=0;
		}
		else if(a[0][1]==2)
		{
			f=31;
		}else if(a[0][1]==3)
		{
			f=59;
		}else if(a[0][1]==4)
		{
			f=90;
		}else if(a[0][1]==5)
		{
			f=120;
		}else if(a[0][1]==6)
		{
			f=151;
		}else if(a[0][1]==7)
		{
			f=181;
		}else if(a[0][1]==8)
		{
			f=212;
		}else if(a[0][1]==9)
		{
			f=243;
		}else if(a[0][1]==10)
		{
			f=273;
		}else if(a[0][1]==11)
		{
			f=304;
		}else
		{
			f=334;
		}
	}
	else{
		if(a[0][1]==1)
		{
			f=0;
		}
		else if(a[0][1]==2)
		{
			f=31;
		}else if(a[0][1]==3)
		{
			f=60;
		}else if(a[0][1]==4)
		{
			f=91;
		}else if(a[0][1]==5)
		{
			f=121;
		}else if(a[0][1]==6)
		{
			f=152;
		}else if(a[0][1]==7)
		{
			f=182;
		}else if(a[0][1]==8)
		{
			f=213;
		}else if(a[0][1]==9)
		{
			f=244;
		}else if(a[0][1]==10)
		{
			f=274;
		}else if(a[0][1]==11)
		{
			f=305;
		}else
		{
			f=335;
		}
	}
	if(a[1][0]%4!=0)
	{
	if(a[1][1]==1)
		{
			g=0;
		}
		else if(a[1][1]==2)
		{
			g=31;
		}else if(a[1][1]==3)
		{
			g=59;
		}else if(a[1][1]==4)
		{
			g=90;
		}else if(a[1][1]==5)
		{
			g=120;
		}else if(a[1][1]==6)
		{
			g=151;
		}else if(a[1][1]==7)
		{
			g=181;
		}else if(a[1][1]==8)
		{
			g=212;
		}else if(a[1][1]==9)
		{
			g=243;
		}else if(a[1][1]==10)
		{
			g=273;
		}else if(a[1][1]==11)
		{
			g=304;
		}else
		{
			g=334;
		}
	}
	else{
		if(a[1][1]==1)
		{
			g=0;
		}
		else if(a[1][1]==2)
		{
			g=31;
		}else if(a[1][1]==3)
		{
			g=60;
		}else if(a[1][1]==4)
		{
			g=91;
		}else if(a[1][1]==5)
		{
			g=121;
		}else if(a[1][1]==6)
		{
			g=152;
		}else if(a[1][1]==7)
		{
			g=182;
		}else if(a[1][1]==8)
		{
			g=213;
		}else if(a[1][1]==9)
		{
			g=244;
		}else if(a[1][1]==10)
		{
			g=274;
		}else if(a[1][1]==11)
		{
			g=305;
		}else
		{
			g=335;
		}
	}
		h=x+g+a[1][2]-f-a[0][2];
		printf("%d\n",h);
}
int leapyearmonth[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
int commonyearmonth[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int dayofyear[2] = {365,366};
//????????
int IsLeapYear(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	else
		return 0;
}

int main()
{
int startYear,startMonth,startDay;
int endYear,endMonth,endDay;
scanf("%d%d%d",&startYear,&startMonth,&startDay);
scanf("%d%d%d",&endYear,&endMonth,&endDay);
int daybetweendates = 0;
int i,j,k;
	if(endYear == startYear)
	{
	int startdate = 0,enddate = 0;
	if(IsLeapYear(startYear)==1)
	{
		startdate += startDay;
		for(i = 0;i < startMonth - 1;i++)
			startdate += leapyearmonth[i];
		enddate += endDay;
		for(i = 0;i < endMonth - 1;i++)
			enddate += leapyearmonth[i];
	}
	if(IsLeapYear(startYear)==0)
	{
		startdate += startDay;
		for(i = 0;i < startMonth - 1;i++)
			startdate += commonyearmonth[i];
		enddate += endDay;
		for(i = 0;i < endMonth - 1;i++)
			enddate += commonyearmonth[i];
	}
	daybetweendates += enddate - startdate;
	}
	if(endYear - startYear > 0)
	{
	for(i = 1;i < endYear - startYear;i++)
	{
		daybetweendates += dayofyear[IsLeapYear(startYear + i)];
	}
	if(IsLeapYear(startYear)==1)
	{
	daybetweendates += leapyearmonth[startMonth - 1] - startDay;
	for(j = startMonth;j < 12;j++)
	{
		daybetweendates += leapyearmonth[j];
	}
	}
	if(IsLeapYear(startYear)==0)
	{
	daybetweendates += commonyearmonth[startMonth - 1] - startDay;
	for(k = startMonth;k < 12;k++)
	{
		daybetweendates += commonyearmonth[k];
	}
	}
	if(IsLeapYear(endYear)==1)
	{
	daybetweendates += endDay;
	for(j = 0;j < endMonth - 1;j++)
	{
		daybetweendates += leapyearmonth[j];
	}
	}
	if(IsLeapYear(endYear)==0)
	{
	daybetweendates += endDay;
	for(k = 0;k < endMonth - 1;k++)
	{
		daybetweendates += commonyearmonth[k];
	}
	}	
	}
	printf("%d\n",daybetweendates);
	return 0;
}
int main()
{
	int year,month,day,Year,Month,Day;
	scanf("%d %d %d",&year,&month,&day);
	scanf("%d %d %d",&Year,&Month,&Day);
	int m[]={0,31,59,90,120,151,181,212,243,273,304,334};
	int i,date;
	for(i=0;i<=11;i++)
	{
		if(Month==i+1)
		{
			date=m[i];
			break;
		}
	}
	date=date+Day;
	for(i=0;i<=11;i++)
	{
		if(month==i+1)
		{
			date=date+365-m[i];
			break;
		}
	}
	date=date-day;
	int r;
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
	{
		r=floor((Year-year)/4)+1;
	}
	else
	{
		if(year%4==1)
		{
			r=floor((Year-year+1)/4);
		}
		else
		{
			if(year%4==2)
			{
				r=floor((Year-year+2)/4);
			}
			else
			{
				if(year%4==3)
				{
					r=floor((Year-year+3)/4);
				}
			}
		}
	}
	if(((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))&&(month>2))
	{
		r=r-1;
	}
	if(((Year % 4 == 0 && Year % 100 != 0) || (Year % 400 == 0))&&(Month<3))
	{
		r=r-1;
	}
	int h=year%400,s=year%100;
	r=r-floor((Year-year+s)/100)+floor((Year-year+h)/400);
	date=date+r+365*(Year-year-1);
	printf("%d",date);
	return 0;
}
int main()
{
	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}};
	int year1;
	int year2;
	int month1;
	int month2;
	int day1;
	int day2;
	int i;
	int sum=0;
	cin>>year1>>month1>>day1;
	cin>>year2>>month2>>day2;
	
	while(month1!=month2||year1!=year2)
	{
		if((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
			   sum=sum+day[1][month1];
		   else
			      sum=sum+day[0][month1];
		if(month1==12){    month1=month1-12;
						  year1=year1+1;
					   }
		else month1++;
	}
	sum=sum+day2-day1;
	cout<<sum;
}
int main() {
	int startYear, startMonth, startDay;
	int endYear, endMonth, endDay;
	int Day[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	int day = 0;
	cin >> startYear >> startMonth >> startDay;
	cin >> endYear >> endMonth >> endDay;
	for (int i = startYear; i < endYear; i++) {
		if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
			day = day + 366;
		else
			day = day + 365;
	}
	if ((endYear % 4 == 0 && endYear % 100 != 0) || endYear % 400 == 0)
		Day[2] = 29;
	for (int i = 1; i < endMonth; i++) {
		day = day + Day[i];
	}
	day = day + endDay;
	if ((startYear % 4 == 0 && startYear % 100 != 0) || startYear % 400 == 0)
		Day[2] = 29;
	else
		Day[2] = 28;
	for (int i = 1; i < startMonth; i++) {
		day = day - Day[i];
	}
	day = day - startDay;
	cout << day;
	return 0;
}
int main (){
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int y1,y2,m1,m2,d1,d2;
	int ysum=0,msum=0,dsum=0;
	int i;
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	for(i=y1+1;i<y2;i++){
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
			ysum = ysum + 366;
		else ysum = ysum + 365;}
	if(y2-y1==0){
		for(i=m1+1;i<m2;i++){
		if((((y1%4==0)&&(y1%100!=0))||(y1%400==0))&&(i==2))
			msum = msum + 29;
		else msum = msum +a[i];
		}
		if(m1==m2)dsum = d2-d1;
		else {if((((y1%4==0)&&(y1%100!=0))||(y1%400==0))&&(m1==2))
			dsum = dsum + 29 - d1;
		else dsum = dsum + a[m1] - d1;
		dsum = dsum + d2;}
		}
	else {
		for(i=m1+1;i<=12;i++){
			if((((y1%4==0)&&(y1%100!=0))||(y1%400==0))&&(i==2))
						msum = msum + 29;
					else msum = msum +a[i];
		}
		for(i=1;i<m2;i++){
			if((((y2%4==0)&&(y2%100!=0))||(y2%400==0))&&(i==2))
						msum = msum + 29;
					else msum = msum +a[i];
		}
		if((((y1%4==0)&&(y1%100!=0))||(y1%400==0))&&(m1==2))
					dsum = dsum + 29 - d1;
				else dsum = dsum + a[m1] - d1;
				dsum = dsum + d2;
	}
	cout<<dsum+msum+ysum;
	return 0;
}
int main()
{
    int y1, y2 ,m1, m2, d1, d2, s, sum1 = 0, sum2 = 0, i;
    int md[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};
    cin >> y1 >> m1 >> d1;
    cin >> y2 >> m2 >> d2;
    for (i = 1; i <= y1-1; i++)
        if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
            sum1 = sum1 + 366 ;
        else sum1 = sum1 + 365; 
    for (i = 1; i <= m1-1;i++)
        if  ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
            sum1 = sum1 + md[1][i];
        else  sum1 = sum1 + md[0][i];
      sum1 = sum1 + d1;

    for (i = 1; i <= y2-1; i++)
        if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
            sum2 = sum2 + 366 ;
        else sum2 = sum2 + 365; 
    for (i = 1; i <= m2-1;i++)
        if  ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
            sum2 = sum2 + md[1][i];
        else  sum2 = sum2 + md[0][i];
      sum2 = sum2 + d2;
      s = sum2 - sum1;
    if ( s >= 0) cout << s << endl;
    else cout << -s << endl;
    return 0;
}
int main()
{
	int y1,m1,d1,y2,m2,d2,total1=0,total2=0,t,i,e,f,x1,x2; 
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31} ;

 scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2); 
 i=0;
 e=0;
 f=0;
 x1=0;
 x2=0;


for(i=0;i<m1;i++)
 {  e=a[i]+e;} 

if(((y1%4==0&&y1%100!=0)||(y1%400==0))&&m1>2)
e=e+1;

 for(i=0;i<m2;i++)
 {  f=a[i]+f;} 

 if(((y2%4==0&&y2%100!=0)||(y2%400==0))&&m2>2)
	 f=f+1;





for(i=1;i<y1;i++)
 {   if((i%4==0&&i%100!=0)||(i%400==0)) 
{x1=x1+366;}
else{x1=x1+365;}
     } 

for(i=1;i<y2;i++)
 {   if((i%4==0&&i%100!=0)||(i%400==0)) 
{x2=x2+366;}
else{x2=x2+365;}
     } 

 total1=x1+e+d1;
 total2=x2+f+d2;
 
 t=total2-total1;
 
 printf("%d\n",t); 
}
int main()
{
	int sy,sm,sd,ey,em,ed;
	int i,x=0;
	scanf("%d%d%d%d%d%d",&sy,&sm,&sd,&ey,&em,&ed);
	for(i=sy;i<ey;i++)
		if(i%4==0&&i%100!=0||i%400==0)
			x=x+366;
		else x=x+365;
	for(i=1;i<sm;i++)
		if((sy%4==0&&sy%100!=0||sy%400==0)&&i==2)
			x=x-29;
		else if(i==2) x=x-28;
		else if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) x=x-31;
		else x=x-30;
	for(i=1;i<em;i++)
		if((ey%4==0&&ey%100!=0||ey%400==0)&&i==2)
			x=x+29;
		else if(i==2) x=x+28;
		else if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) x=x+31;
		else x=x+30;
	x=x+ed-sd;
	printf("%d\n",x);
	return 0;
}
void main()
{
    int a,b,c,A,B,C;
    int i=0;
    scanf("%d%d%d%d%d%d",&a,&b,&c,&A,&B,&C);
  while(a!=A||b!=B||c!=C)
  {
    if(b==1||b==3||b==5||b==7||b==8||b==10||b==12)
    {
        if(c==31) {b++;c=1;}
        else c++;
        if(b==13) {a++;b=1;}
    }
    else if(b==4||b==6||b==9||b==11)
    {
        if(c==30) {b++;c=1;}
        else c++;
    }
    else if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
    {
        if(c==29) {b++;c=1;}
        else c++;

    }
    else
    {
        if(c==28) {b++;c=1;}
        else c++;
       
    }
      i++;
  }
     printf("%d",i);
}
int main()
{
	int d[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	int y1 = 0;
	int m1 = 0;
	int d1 = 0;
	int y2 = 0;
	int m2 = 0;
	int d2 = 0;
	int i = 0;
	int j = 0;
	int sum = 0;

	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
	if (y1 != y2)
	{
		if ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0) && (m1 <= 2))
			sum++;
		for (i = 12; i > m1; i--)
			sum += d[i];
		sum += d[m1] - d1;
		for (i = y1 + 1; i < y2; i++)
		{
			if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
				sum++;
			sum += 365;
		}
		if ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0) && (m2 > 2))
			sum += 1;
		for (i = 1; i < m2; i++)
			sum += d[i];
		sum += d2;
		cout << sum;
	}
	else
	{
		if ((m1 <= 2) && (m2 > 2))
			sum++;
		if (m2 > m1)
		{
			for (i = m1 + 1; i < m2; i++)
				sum += d[i];
			sum += d[m1] - d1;
			sum += d2;
		}
		else
			sum += d2 - d1;
		cout << sum;
	}

	return 0;
}