#include <stdio.h>
#include <time.h>

int datediff(int y1,int m1,int d1,int y2,int m2,int d2)
{
	struct tm ptr1;
	ptr1.tm_sec=10;
	ptr1.tm_min=10;
	ptr1.tm_hour=10;
	ptr1.tm_mday=d1;
	ptr1.tm_mon=m1-1;
	ptr1.tm_year=y1-1900;   
	time_t st1=mktime(&ptr1);
	struct tm ptr2;
	ptr2.tm_sec=10;
	ptr2.tm_min=10;
	ptr2.tm_hour=10;
	ptr2.tm_mday=d2;
	ptr2.tm_mon=m2-1;
	ptr2.tm_year=y2-1900;   
	time_t st2=mktime(&ptr2);
	return (int)((st2-st1)/3600/24);
}

int main (void)
{
	int t=datediff(2015,1,9,2015,2,18);
	printf("%d",t);
	return 0;
}