1. 提拉米苏宫殿

program ysf;
var
        m, n, i, j : integer;
        a : array[1 .. 100] of boolean;
begin
        readln(n, m);
        for i := 1 to n do
                a[i] := true;
        for i := 2 to m do
        begin
                j := i;
                while j <= n do
                begin
                        a[j] := not a[j];
                        j := j+i;
                end;

        end;
        for i := 1 to n do
                if a[i] then
                        write(i, '  ');
        writeln;
end.
posted @ 2010-01-30 19:57  SmartIOI  阅读(115)  评论(0)    收藏  举报
本站采用CC授权如需转载、引用文章,请务必附上作者及来源处。 Creative Commons License