Var m,h:integer;
f1,f2,f3:text;
begin
write('m: ');
readln(m);
write('h: ');
readln(h);
assign(f1,'A.txt');
rewrite(f1);
var a:=ArrRandom(10,1,56);
writeln(f1,a);
close(f1);
assign(f2,'B.txt');
rewrite(f2);
var b:=a.Where(x -> x mod m = 0);
writeln(f2,b);
close(f2) ;
assign(f3,'C.txt');
rewrite(f3);
var c:=a.Where(x -> x mod h = 0);
writeln(f3,c);
close(f3) ;
end.
Пример
m: 5
h: 4
A - [35,51,39,41,16,36,28,20,39,23]
B - [35,20]
C - [16,36,28,20]