semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int year1,month1,day1,year2,month2,day2;
	cin >> year1 >> month1 >> day1;
	cin >> year2 >> month2 >> day2;
	int Month1[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	int Month2[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
	int count = 0,i;
	if((year1 % 4 == 0&&year1 % 100 != 0)||(year1 % 400 == 0))
	{
		for(i = month1; i <= 12; i++)
			count = count + Month2[i];
		count = count - day1;
	}
	else
	{
		for(i = month1; i <= 12; i++)
			count = count + Month1[i];
		count = count - day1;
	}
	for(i = year1 + 1; i < year2; i++)
	{
		if((i % 4 == 0&&i % 100 != 0)||(i % 400 == 0))
			count = count + 366;
		else
			count = count + 365;
	}
	if((year2 % 4 == 0&&year2 % 100 != 0)||(year2 % 400 == 0))
	{
		for(i = 1; i < month2; i++)
			count = count + Month2[i];
		count = count + day2;
	}
	else
	{
		for(i = 1; i < month2; i++)
			count = count + Month1[i];
		count = count + day2;
	}
	if(year1 != year2)
		cout << count;
	else
	{
		if((year1 % 4 == 0&&year1 % 100 != 0)||(year1 % 400 == 0))
			cout << count - 366;
		else
			cout << count - 365;
	}
	return 0;
}
/*
 * c.cpp
 * ???1100012870;
 * ???????
 *  Created on: 2011-11-4
 *      Author: Li Wenpeng
 */
int judge(int x)
{
	if (x%400==0) return 1;
	if (x%100==0) return 0;
	if (x%4==0) return 1;
	return 0;
}
int main()
{
	const int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int year1,year2,day1,day2,month1,month2,i,ans=0;
	cin>>year1>>month1>>day1>>year2>>month2>>day2;
	if (year1==year2){
		for(i=month1;i<month2;i++) ans=ans+a[i];
		ans=ans+day2-day1;
		cout<<ans<<endl;
		return 0;
	}
    for(i=year1+1;i<year2;i++)
    	ans=ans+365+judge(i);
    for(i=1;i<month2;i++){
    	ans=ans+a[i];
    	if(i==2)ans=ans+judge(year2);
    }
    for(i=month1;i<=12;i++){
    	ans=ans+a[i];
    	if(i==2)ans=ans+judge(year1);
    }
    ans=ans+day2-day1;
    cout<<ans<<endl;
    return 0;
}
int main()
{
	int y1,m1,d1,y2,m2,d2;
	int i;
	int x=0;
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	i=y1;
	for(i=y1;i<y2;i++){
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
			x=x+366;
		else
			x=x+365;
	}
	switch(m1){
	case 1:break;
	case 2:x=x-31;break;
    case 3:x=x-59;break;
	case 4:x=x-90;break;
	case 5:x=x-120;break;
	case 6:x=x-151;break;
	case 7:x=x-181;break;
	case 8:x=x-212;break;
	case 9:x=x-243;break;
	case 10:x=x-273;break;
	case 11:x=x-304;break;
	case 12:x=x-334;break;
	}
	switch(m2){
	case 1:break;
	case 2:x=x+31;break;
    case 3:x=x+59;break;
	case 4:x=x+90;break;
	case 5:x=x+120;break;
	case 6:x=x+151;break;
	case 7:x=x+181;break;
	case 8:x=x+212;break;
	case 9:x=x+243;break;
	case 10:x=x+273;break;
	case 11:x=x+304;break;
	case 12:x=x+334;break;
	}
	x=x-d1+d2;
	if((((y1%4==0)&&(y1%100!=0))||(y1%400==0))&&m1>2)
		x=x-1;
    if((((y2%4==0)&&(y2%100!=0))||(y2%400==0))&&m2>2)
		x=x+1;
	printf("%d\n",x);
	return 0;
}
int main()
{
	int startYear, startMonth, startDay, endYear, endMonth, endDay, ans = 0, day = 0, i;
	cin >> startYear >> startMonth >> startDay >> endYear >> endMonth >> endDay;
	for (i = startYear; i < endYear; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			ans = ans + 366;
		else
			ans = ans + 365;
	}
	for (i = 1; i < startMonth; i++)
	{
		if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12))
			day = day + 31;
		else if (i == 2)
			{
				if ((startYear % 4 == 0 && startYear % 100 != 0) || (startYear % 400 == 0))
					day = day + 29;
				else
					day = day + 28;
			}
			else
				day = day + 30;
	}
	for (i = 1; i < startDay; i++)
		day++;
	ans = ans - day;
	day = 0;
	for (i = 1; i < endMonth; i++)
	{
		if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12))
			day = day + 31;
		else if (i == 2)
			{
				if ((endYear % 4 == 0 && endYear % 100 != 0) || (endYear % 400 == 0))
					day = day + 29;
				else
					day = day + 28;
			}
			else
				day = day + 30;
	}
	for (i = 1; i < endDay; i++)
		day++;
	ans = ans + day;
	cout << ans << endl;
	return 0;
}
int main(){
    int startYear,startMonth,startDay,endYear,endMonth,endDay;
    int s,i,days,days1,days2,year;
    cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
    days=0;days1=0;days2=0;
    int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    for(i=1;i<startMonth;i++)
    {if((startYear%4==0&&startYear%100!=0)||(startYear%400==0))
		month[2]=29;
    	days1=days1+month[i];}
    days1=days1+startDay;
    for(i=endMonth;i<13;i++)
    	{if((endYear%4==0&&endYear%100!=0)||(endYear%400==0))
    		month[2]=29;
    	days2=days2+month[i];}
    days2=days2-endDay;
    s=0;
    for(year=startYear;year<=endYear;year++)
    	if((year%4==0&&year%100!=0)||(year%400==0))
    		s++;
    days=365*(endYear-startYear+1)-days2-days1+s;
    cout<<days;
  return 0;
}
int main()
{
    int runday[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int brunday[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int year1, year2, month1, month2, day1, day2, i, j, sum = 0;
    cin >> year1 >> month1 >> day1;
    cin >> year2 >> month2 >> day2;
    for ( i = year1; i < year2; i++ )
    {
        if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
           sum = sum + 366;
        else
            sum = sum + 365;
    }
    if ((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
    {
        for ( i = 1; i < month1; i++ )
        {
            sum = sum - runday[i];
        }
        sum = sum - day1;
    }
    else
    {
        for ( i = 1; i < month1; i++ )
        {
            sum = sum - brunday[i];
        }
        sum = sum - day1;
    }
    if ((year2 % 4 == 0 && year2 % 100 != 0) || (year2 % 400 == 0))
    {
        for ( i = 1; i < month2; i++ )
        {
            sum = sum + runday[i];
        }
        sum = sum + day2;
    }
    else
    {
        for ( i = 1; i < month2; i++ )
        {
            sum = sum + brunday[i];
        }
        sum = sum + day2;
    }
    cout << sum << endl;
    return 0;
}
int main()
{
	int a1,b1,c1,d1,a2,b2,c2,d2,r1=0,i,d;
	scanf("%d%d%d",&a1,&b1,&c1);
	scanf("%d%d%d",&a2,&b2,&c2);
	for(i=a1+1;i<=a2-1;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			r1++;
	}
	if(b1==1)
		d1=c1;
	else if(b1==2)
		d1=31+c1;
	else if(b1==3)
		d1=59+c1;
	else if(b1==4)
		d1=90+c1;
	else if(b1==5)
		d1=120+c1;
	else if(b1==6)
		d1=151+c1;
	else if(b1==7)
		d1=181+c1;
	else if(b1==8)
		d1=212+c1;
	else if(b1==9)
		d1=243+c1;
	else if(b1==10)
		d1=273+c1;
	else if(b1==11)
		d1=304+c1;
	else
		d1=334+c1;
	if(b2==1)
		d2=c2;
	else if(b2==2)
		d2=31+c2;
	else if(b2==3)
		d2=59+c2;
	else if(b2==4)
		d2=90+c2;
	else if(b2==5)
		d2=120+c2;
	else if(b2==6)
		d2=151+c2;
	else if(b2==7)
		d2=181+c2;
	else if(b2==8)
		d2=212+c2;
	else if(b2==9)
		d2=243+c2;
	else if(b2==10)
		d2=273+c2;
	else if(b2==11)
		d2=304+c2;
	else
		d2=334+c2;
	if((a1 % 4 == 0 && a1 % 100 != 0) || (a1 % 400 == 0)&&(d1<50))
		r1++;
	if((a2 % 4 == 0 && a2 % 100 != 0) || (a2 % 400 == 0)&&(d2>50))
		d2++;
	if(a2!=a1)
		d=d2-d1+r1+365*(a2-a1);
	else
		d=d2-d1+r1;
	printf("%d",d);
}
const int dom[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 main(){
  long sy,sm,sd,ey,em,ed,ans;
  int i,flag;
  scanf("%d%d%d%d%d%d",&sy,&sm,&sd,&ey,&em,&ed);
  ans=365*(ey-sy+1);
  for (i=sy;i<=ey;i++)
    if (!(i%4)&&(i%100)||!(i%400)) ans++;
  if (sm>1){
    if (!(sy%4)&&(sy%100)||!(sy%400)) flag=1;
    else flag=0;
    for (i=1;i<sm;i++)
      ans-=dom[flag][i];
  }
  if (em<12){
    if (!(ey%4)&&(ey%100)||!(ey%400)) flag=1;
    else flag=0;
    for (i=em+1;i<=12;i++)
      ans-=dom[flag][i];
  }
  ans-=sd;
  if (!(ey%4)&&(ey%100)||!(ey%400)) flag=1;
  else flag=0;
  ans-=dom[flag][em]-ed;
  printf("%d",ans);
}