#include
#include
int main()
{
int n, i;
int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int day = 0, days;
printf("Please input n:");
scanf("%d", &n);
if(n==0)
exit(0);
for(i = 0; i < n-1; i++)
{
day+=month[i];
}
days = day % 7 + 1;
if(days==7)days=0;
printf("日\t一\t二\t三\t四\t五\t六\n");
for(i = 1; i <= month[n-1]+days;i++)
{
if(i <= days && days != 7)
{
printf("\t");
}
else
{
printf("%2d\t", i-days);
if(i%7==0)
{
printf("\n");
}
}
}
printf("\n");
return 0;
}