关于谭浩强c语言第九章第一题

如图,请问一下为什么运行到这儿就不运行了?

img


代码如下:

#include

int a = 0, b, c, date1, two1 = 28, two2 = 29;

struct lun {
    int year;
    int month;
    int day;
}date;

int main()
{
    void judge(struct lun date);
    printf("please input your date:");
    scanf("%d %d %d", &date.year, &date.month, &date.day);
    judge(date);
    if (date.month <= 1)
        date1 = date.month * 31 + date.day;
    b = date.month / 2;
    c = date.month % 2;
    if (a == 1)
    {
        if (c != 0)
            date1 = (date.month - 1) * 30 + two2 + (b + 1);
        else
            date1 = (date.month - 1) * 30 + b + two2;
    }
    else
    {
        if (c != 0)
            date1 = (date.month - 1) * 30 + two1 + (b + 1);
        else
            date1 = (date.month - 1) * 30 + b +two1;
    }
    printf("the date is %s's %d day.", date.year, date1);
    return 0;
}

void judge(struct lun date)
{
    if (date.year % 4 == 0)
    {
        if (date.year % 100 != 0)
        {
            a = 1;
            printf("the year is a leap year.");
        }
        else
        {
            if (date.year % 400 == 0)
            {
                a = 1;
                printf("the year is a leap year.");
            }
            else
                printf("the year is not a leap year.");
        }
    }
    else
        printf("the year is not a leap year.");
}

printf("the date is %s's %d day.", date.year, date1);
改为
printf("the date is %d's %d day.", date.year, date1);