该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
main()
{
int year,month,day=0,a,b,week,c,i,sum=0,days,d;
printf("please input year,month,days\n");
scanf("%d,%d,%d",&year,&month,&days);
for(i=1;i
{
if (year%4==0)
{
if(year%100==0)
{
if (year%400==0) a=1;
else a=0;
}
else
a=1;
}
else
a=0;
{
if(a=1)
b=366;
else
b=365;
}
sum=b+sum;
}
printf("sum is %d\n",sum);
if (year%4==0)
{
if(year%100==0)
{
if (year%400==0) a=1;
else a=0;
}
else
a=1;
}
else
a=0;
for(i=1;i
{
switch(i)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:d=31;break;
case 4:
case 6:
case 9:
case 11:d=30;break;
case 2: if (a) d=29;
else d=28;
break;
default:d=0;
}
day=d+day;
}
printf("day is %d\n",day);
printf("days is %d\n",days);
sum=sum+day+days;
sum=sum%7;
printf("%d的%d月是%d日星期%d\n",year,month,days,sum);
}