恩恩,给个邮箱,一会发给你!
var i,d,s,y,m:longint;
q:array[1..12] of longint=(31,0,31,30,31,30,31,31,30,31,30,31);
begin
readln(y,m);
if (y mod 4=0) and (y mod 100<>0) and (y mod 400=0) then q[2]:=29
else q[2]:=28;
s:=y-1+(y-1) div 4-(y-1) div 100+(y-1) div 400+1;
d:=s;
for i:=1 to m-1 do d:=d+q[i];
d:=d mod 7;
writeln('Sun Mon Tue Wed Thu Fri Sat ');
write(1:(d+1)*4-3, ' ':3);
for i:=2 to q[m] do begin
write(i);
if(i<10) then write(' ':3)
else write(' ':2);
if((i+d) mod 7=0) then
writeln;
end;
end.