求助
给定年月日,求其为一年的第N天:以下是我的程序,系统报错,我实在找不出了,求助!
#include<stdio.h>
void main()
{
int y,m,d,result,le,i,S[2][13];
printf("please imput the day of year:");
scanf("%d%d%d",y,m,d);
S[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},
{0,31,29,31,30,31,30,31,31,30,31,30,31}};
le=((y%4==0&&y%100!=0)||y%400==0);
for(i=0;i<m;i++)
{
result=d+S[le][i];
}
// return re;
printf("result is %d",result);
}