指定した年の日数を返す

使うときはエラー処理とか入れてね。

#include <time.h>
long count_day(long year){
	
	tm data;
	data.tm_year = year-1900+1;
	data.tm_mon = -1+1;
	data.tm_mday = 1;
	data.tm_hour = 0;
	data.tm_min = 0;
	data.tm_sec = 0;
	data.tm_isdst = 0;
	time_t next_time = mktime(&data);
	
	data.tm_year = year-1900;
	time_t calc_time = mktime(&data);

	long result = (next_time-calc_time)/(60*60*24);
	return result;
}