求解 关于类型转换的问题
#include<stdio.h>struct date{
int year;
int month;
int day;
};
int DAY(struct date Day){
int sum=0;
if((Day.year%4==0)&&(Day.year%100!=0)||(Day.year%400==0)){
if(Day.month==1)
sum=Day.day;
else
if(Day.month<=2)
sum=31*Day.month/2+Day.day;
else
if(Day.month%2!=0)
sum=31*Day.month/2+(Day.month/2-1)*30+28+Day.day;
else
sum=31*Day.month/2+30*(Day.month/2-2)+28+Day.day;
printf("今年是一个闰年!\n");
}
else{
if(Day.month==1)
sum=Day.day;
else
if(Day.month<=2)
sum=31*Day.month/2+Day.day;
else
if(Day.month%2!=0)
sum=31*Day.month/2+(Day.month/2-1)*30+29+Day.day;
else
sum=31*Day.month/2+30*(Day.month/2-2)+29+Day.day;
printf("今年是平年!\n");
}
printf("the day is %d\n",sum);
}
void main(){
struct date a;
printf("enter a\n");
scanf("%d %d %d",&a.year,&a.month,&a.day);
int DAY(a);
}这是今天编写的一个使用结构体确定某一年的某一天是今年的多少天的问题,但是最后在有这样一句报错,请教各位帮助解答 真诚谢过!本人刚自学C语言 所以有点白 请包涵 !!!