请问 2009年8月8日是星期六 2010年10月是星期几?要解释每一步算式!10月1日

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 08:24:52
请问 2009年8月8日是星期六 2010年10月是星期几?要解释每一步算式!10月1日

请问 2009年8月8日是星期六 2010年10月是星期几?要解释每一步算式!10月1日
请问 2009年8月8日是星期六 2010年10月是星期几?要解释每一步算式!
10月1日

请问 2009年8月8日是星期六 2010年10月是星期几?要解释每一步算式!10月1日
两个日期间的天数(2010不是闰年365天,8月份剩下天数31-8,9月份30天,到10月1天):
365+31-8+30+1=419(天)
一星期7天,总星期数和不满星期(余下)天数:
419÷7=59……6
星期六再过6天是星期五.

31-8+30+1=54(天)54÷7=7(个)……5(天) 答案是星期四。。。 绝对是对的、、、

#include
#include
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)

全部展开

#include
#include
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);
}
10月1日即星期五

收起

2009年8月8日是星期六
到2010年8月8日过了365天
到2010年9月8日过了31天
到2010年10月8日过了30天
一共365+31+30=426天
426÷7=60 余6天
再+1天就没有余数了
所以到2010年10月9日 也是星期六
2010年10月2日 也是星期六
2010年10月1日 为星期五请问到201...

全部展开

2009年8月8日是星期六
到2010年8月8日过了365天
到2010年9月8日过了31天
到2010年10月8日过了30天
一共365+31+30=426天
426÷7=60 余6天
再+1天就没有余数了
所以到2010年10月9日 也是星期六
2010年10月2日 也是星期六
2010年10月1日 为星期五

收起

10月几号呀

不知 星期五