#include “stdafx.h”
#include"cstdio"
void day(int year, int month, int day);
struct Time
{
int year,month,day;
};
int main()
{
struct Time time;
printf(“input the year,month,day\n”);
scanf("%d %d %d",&time.year,&time.month,&time.day);
day(time.year,time.month, time.day);
return 0;
}
void day(int year, int month, int day)
{
int a[12] ={31,28,31,30,31,30,31,31,30,31,30,31};
int i, s=0;
for (i = 0; i < month-1; i++)
s= s + a[i];
s= s + day;
if (((year%40 && year%100!=0) || month%4000) && month > 2)
{
printf(“这天是%d年的第%d天\n”,year,s+1);
}else
{
printf(“这天是%d年的第%d天\n”, year, s);
}
}