【关于结构体与函数的应用】 求助 谢谢
这是我的思路 代码不完全正确 怎么修改?#include <stdio.h>
struct DATE
{
int year;
int month;
int day;
}date;
int main ()
{
void find(struct DATE);
int i = 0;
int days = 0;
int month_LeapYear[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int month_AverageYear[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
printf ("输入年月日 : ");
scanf ("%d %d %d", &date.year, &date.month, &date.day);
find (date);
void find(struct DATE date);
{
if (date.year%4 == 0 || date.year%400 == 0)
{
for (i=0; i < date.month-1; i++)
{
days = month_LeapYear[i] + days;
}
days = days + date.day;
}
else
{
for (i=0; i < date.month-1; i++)
{
days = month_AverageYear[i] + days;
}
days = days + date.day;
}
}
printf("该日是该年的第%d天\n", days);
}