2010年10月1日是星期几? 2009年8月8日是星期六
发布网友
发布时间:2024-12-24 16:58
我来回答
共4个回答
热心网友
时间:2024-12-24 19:48
星期五
热心网友
时间:2024-12-24 19:47
我要算过程
热心网友
时间:2024-12-24 19:49
#include<stdio.h>
#include<math.h>
void main()
{
int y,r,x,n,t,a,s;
n=1900;
printf("请输入1900年其中的一天:");
scanf("%d%*c%d",&y,&r);
if(n%4==0 && n%100!=0|| n%400==0)
{
switch(y)
{
case 1:
printf("%d\n",s=r);break;
case 2:
printf("%d\n",s=r+31);break;
case 3:
printf("%d\n",s=r+31+29);break;
case 4:
printf("%d\n",s=r+31+29+31);break;
case 5:
printf("%d\n",s=r+31+29+31+30);break;
case 6:
printf("%d\n",s=r+31+29+31+30+31);break;
case 7:
printf("%d\n",s=r+31+29+31+30+31+30);break;
case 8:
printf("%d\n",s=r+31+29+31+30+31+30+31);break;
case 9:
printf("%d\n",s=r+31+29+31+30+31+30+31+31);break;
case 10:
printf("%d\n",s=r+31+29+31+30+31+30+31+31+30);break;
case 11:
printf("%d\n",s=r+31+29+31+30+31+30+31+31+30+31);break;
case 12:
printf("%d\n",s=r+31+29+31+30+31+30+31+31+30+31+30);break;
default:
printf("输入错误");
}
}
else
{
switch(y)
{
case 1:
printf("%d\n",s=r);break;
case 2:
printf("%d\n",s=r+31);break;
case 3:
printf("%d\n",s=r+31+28);break;
case 4:
printf("%d\n",s=r+31+28+31);break;
case 5:
printf("%d\n",s=r+31+28+31+30);break;
case 6:
printf("%d\n",s=r+31+28+31+30+31);break;
case 7:
printf("%d\n",s=r+31+28+31+30+31+30);break;
case 8:
printf("%d\n",s=r+31+28+31+30+31+30+31);break;
case 9:
printf("%d\n",s=r+31+28+31+30+31+30+31+31);break;
case 10:
printf("%d\n",s=r+31+28+31+30+31+30+31+31+30);break;
case 11:
printf("%d\n",s=r+31+28+31+30+31+30+31+31+30+31);break;
case 12:
printf("%d\n",s=r+31+28+31+30+31+30+31+31+30+31+30);break;
default:
printf("输入错误");
}
}
if(a=0)
{
switch(y)
{
case 1:
printf("%d\n",s=r);break;
case 2:
printf("%d\n",s=r+31);break;
case 3:
printf("%d\n",s=r+31+29);break;
case 4:
printf("%d\n",s=r+31+29+31);break;
case 5:
printf("%d\n",s=r+31+29+31+30);break;
case 6:
printf("%d\n",s=r+31+29+31+30+31);break;
case 7:
printf("%d\n",s=r+31+29+31+30+31+30);break;
case 8:
printf("%d\n",s=r+31+29+31+30+31+30+31);break;
case 9:
printf("%d\n",s=r+31+29+31+30+31+30+31+31);break;
case 10:
printf("%d\n",s=r+31+29+31+30+31+30+31+31+30);break;
case 11:
printf("%d\n",s=r+31+29+31+30+31+30+31+31+30+31);break;
case 12:
printf("%d\n",s=r+31+29+31+30+31+30+31+31+30+31+30);break;
default:
printf("输入错误");
}
}
else
{
switch(y)
{
case 1:
printf("%d\n",s=r);break;
case 2:
printf("%d\n",s=r+31);break;
case 3:
printf("%d\n",s=r+31+28);break;
case 4:
printf("%d\n",s=r+31+28+31);break;
case 5:
printf("%d\n",s=r+31+28+31+30);break;
case 6:
printf("%d\n",s=r+31+28+31+30+31);break;
case 7:
printf("%d\n",s=r+31+28+31+30+31+30);break;
case 8:
printf("%d\n",s=r+31+28+31+30+31+30+31);break;
case 9:
printf("%d\n",s=r+31+28+31+30+31+30+31+31);break;
case 10:
printf("%d\n",s=r+31+28+31+30+31+30+31+31+30);break;
case 11:
printf("%d\n",s=r+31+28+31+30+31+30+31+31+30+31);break;
case 12:
printf("%d\n",s=r+31+28+31+30+31+30+31+31+30+31+30);break;
default:
printf("输入错误");
}
}
s=s%7;
if(s==0)
printf("\b\b\b\b\b\b星期日\n");
else
printf("星期%d\n",s);
}
热心网友
时间:2024-12-24 19:49
是星期五哦!!!