#include<stdio.h>
void main()
{int a,b,c,d=0,i;
printf("輸入年份:");
scanf("%d",&a);
printf("輸入月份:");
scanf("%d",&b);
printf("輸入日期:");
scanf("%d",&c);
printf("\n");
if(a%4==0&&a%100!=0||a%400==0)
{printf("是閏年\n");
int f[12]={31,29,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<b;i++)
d+=f[i];
printf("是今年的第%d天\n",d-f[b-1]+c);}
else
{printf("不是閏年\n");
int f[12]={31,28,31,30,31,30,31,31,30,31,30,31};
}
#include<stdio.h>
void main()
{int a,b,c,d=0,i;
printf("輸入年份:");
scanf("%d",&a);
printf("輸入月份:");
scanf("%d",&b);
printf("輸入日期:");
scanf("%d",&c);
printf("\n");
if(a%4==0&&a%100!=0||a%400==0)
{printf("是閏年\n");
int f[12]={31,29,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<b;i++)
d+=f[i];
printf("是今年的第%d天\n",d-f[b-1]+c);}
else
{printf("不是閏年\n");
int f[12]={31,28,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<b;i++)
d+=f[i];
printf("是今年的第%d天\n",d-f[b-1]+c);}
}