求高手帮忙纠错 nextday问题
#include <stdio.h>#include <stdlib.h>
int n,flag;
int find(int x,int c[n])
{
int i;
for(i=0;i<n;i++)
{
if(x==c[i])
break;
else
flag=0;
}
flag=1;
return flag;
}
int main()
{
int day,month,year,nextday,nextmonth,nextyear;
int a[6]={1,3,5,7,8,10},b[4]={4,6,9,11};
printf("输入今天的日子,以dd,mm,yy的格式:");
scanf("%d%d%d",&day,&month,&year);
printf("\n");
while(1)
{
if(day>31||month>12)
printf("输入有误,重新输入:");
scanf("%d%d%d",&day,&month,&year);
} //输入
find(month,a[6]); [Warning] passing arg 2 of `find' makes pointer from integer without a cast
if(flag==1) //month属于a[6]
{
if(day<30) nextday=day+1;
if(day=31)
{
nextday=1;nextmonth=month+1;
}
}
else if(month,b[4])
{
if(day<29) nextday=day+1;
if(day=30)
{
nextday=1;nextmonth=month+1;
}
}
else if(month==12)
{
if(day<31) nextday=day+1;
else
{
nextday=1;nextmonth=month+1;nextyear=year+1;
}
}
else
{
if((year%4==0&&year%400!=0)||year%400==0)
printf("%d is a leap year.",year);
{
if(day<29) nextday=day+1;
else
{
nextday=1;nextmonth=month+1;
}
}
else 说这句话有syntax error,是怎么错了
{
if(day<28) nextday=day+1;
else
{
nextday=1;nextmonth=month+1;
}
}
} before这个‘}’也有句法错误???
printf("NEXTDAY IS %d %d %d."nextday,nextmonth,nextyear) 说这句话有问题如下:a parameter list with an ellipsis can't match an empty parameter name list declaration
return 0;
}