这个程序出了什么问题?
#include <stdio.h>#include <stdbool.h>
struct date
{
int month;
int day;
int year;
};
int main(void)
{
struct date today,tomorrow;
int numberofdays(struct date a);
printf("Enter today's date(mm dd yyyy):");
scanf("%i%i%i",&today.month,&today.day,&today.year);
if(today.day!=numberofdays(today))
{
tomorrow.day=today.day+1;
tomorrow.month=today.month;
tomorrow.year=today.year;
}
else if(today.month==12)
{
tomorrow.day=1;
tomorrow.month=1;
tomorrow.year=today.year+1;
}
else
{
tomorrow.day=1;
tomorrow.month=today.month+1;
tomorrow.year=today.year;
}
printf("Tomorrow's date is %i/%i/%.2i.\n",tomorrow.month,tomorrow.day,
tomorrow.year%100);
return 0;
}
int numberofdays(struct date a)
{
int days;
bool isleapyear(struct date a)
const int dayspermonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
if(isleapyear(a)==true&&a.month==2)
days=29;
else
days=dayspermonth[a.month-1];
return days;
}
bool isleapyear(struct date a)
{
bool leapyearflag;
if((a.year%4==0&&a.year%100!=0)||
a.year%400==0)
leapyearflag=true;
else
leapyearflag=false;
return leapyearflag;
}
请问这个程序哪里出了问题?为什么在win-tc上编译失败呢?请大家帮帮忙看看