Pascal 语言问题

2024-12-13 23:32:41
推荐回答(1个)
回答1:

var
n,m:integer;
a:array[1..10000] of boolean;
i,j:integer;
begin
readln(n,m);
for i:=1 to n do a[i]:=true;
for j:=1 to m do
for i:=1 to n do if i mod j=0 then a[i]:=not a[i];
for i:=1 to n do if a[i] then write(i:4);
writeln;
end.