#include
main()
{
int day=0;/*天数*/
int count=0;/*起始日是星期几*/
int printdays=0;/*打印天数*/
int i;
printf("Enter number of days in month:\n");
scanf("%d%d",&day,&count);
printdays = day + count - 1;
/*printf("星期日\t星期一\t星期二\t星期三\t星期四\t星期五\t星期六\n");*/
for (i=1; i <= printdays; i++) {
if (i < count)
printf("\t");
else if ((i - count + 1)% 7 == 8 - count)
printf("\n");
else
printf("%d\t", i - count + 1);
}
return 0;
}