这个程序哪里有错误啊?我怎么找不出来啊
#include<stdio.h>
#define P printf
void main()
{
int rn(int leap,int n);
int n,y,r,num,leap;
scanf("%d%d%d",&n,&y,&r);//输入年月日
leap=rn(leap,n); //判断是否是闰年
switch(y)
{
case 1:num=r;
case 2:num=31+r;
case 3:if(leap)num=31+28+r;
else num=31+29+r;
case 4:if(leap)num=31+28+31+r;
else num=31+29+31+r;
case 5:if(leap)num=31+28+31+30+r;
else num=31+29+31+30+r ;
case 6:if(leap)num=31+28+31+30+31+r;
else num=31+29+31+30+31+r;
case 7:if(leap)num=31+28+31+30+31+30+r;
else num=31+29+31+30+31+30+r;
case 8:if(leap)num=31+28+31+30+31+30+31+r;
else num=31+29+31+30+31+30+31+r;
case 9: if(leap)num=31+28+31+30+31+30+31+31+r;
else num=31+29+31+30+31+30+31+31+r;
case 10:if(leap)num=31+28+31+30+31+30+31+31+30+r;
else num=31+29+31+30+31+31+30+31+30+r;
case 11:if(leap)num=31+28+31+30+31+30+31+31+30+31+r;
else num=31+29+31+30+31+30+31+31+30+31+r;
case 12:if(leap)num=31+28+31+30+31+30+31+31+30+31+30+r;
else num=31+29+31+30+31+30+31+31+30+31+30+r;
};
P("%d\n",num);
int rn(int leap,int n) //闰年判断函数
{
if(n%4==0||n%100==0&&n%400==0)
leap=1;
else
leap=0;
rerurn leap;
}
}
我刚学C语言请多多指教!
参考答案:break;