编程在主函数中输入年月日,计算该日是该年的第几天。哪里有错误,请各位帮忙看看。
#include<stdio.h>int a,int b,int c,;
printf("输入年\n");
a=getchar();
printf("输入月\n");
b=getchar();
printf("输入日\n");
c=getchar();
int main()
{
int num(int a,int b,int c);
int n;
printf("%d\n",n);}
int num(int a,int b,int c);
{
int n[]={0};
if(a%4==0)
n[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
else n[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
for(i=1;i<=b-1;i++)
n=n+n[i];
n=n+c;
return(n); }