Int main ()
{
Int n, I, j, k, first, Max.
M int y [10], [10].
The scanf (" % d ", & amp; N);
for(i=0; i
The scanf (" % d % d ", & amp; [I] y, & amp; [I] m);
}
for(i=0; i
Printf (" % % d years. The 2 d month \ n ", [I] y, m [I]);
printf("\n");
Printf (" a 2 3 4 5 6 \ n ");
If (y [I] % 4==0 & amp; & [I] y % 100!=0 & amp; & [I] y %==0 400)
{
[I] if (m==1 | | m [I]==3 | | m [I]==| | m [I]==| | m [I]==| | m [I]==| | m [I]==12)
Max=31;
Else if (m [I]==2)
Max=29;
The else
Max=30;
}
The else
{
[I] if (m==1 | | m [I]==3 | | m [I]==| | m [I]==| | m [I]==| | m [I]==| | m [I]==12)
Max=31;
Else if (m [I]==2)
Max=28;
The else
Max=30;
}
First=(2 + 2 + 3 * * m [I] [I] (m + 1)/5 + y [I] + [I] y/100 + 4 - [I] y/y/400) [I] % 7;
If (first==0) first=7;
If (first==7)
{
For (k=1; k<=3 * first; K++)
{
Printf (" ");
}
Printf (" ");
}
The else
{
For (k=1; k<=3 * first; K++)
{
Printf (" ");
}
}
for(j=1; j<=Max; J++)
{
Printf (" % 3 d ", j);
If ((j + first) % 7==0)
{
printf("\n");
}
If (j==Max)
{
printf("\n");
}
}
printf("\n");
}
return 0;
}
CodePudding user response:
Your algorithm is certainly have problems
Enter a 1, 2006 2 yourself and see what will come out
If (first==0) first=7;
CodePudding user response:
Thank you, I went to kangkang