uses crt;
const MN = 100;
var
a: array [1..MN] of integer;
n: integer;
Procedure Gen(m: integer);
var i: integer;
begin
Writeln('Hay nhap n:');
Readln(n);
randomize; n := m;
for i := 1 to n do a[i] := random(m);
writeln(a[i]);
readln;
end.
Bastkoo Đúng chưa bạn?
uses crt;
var a:array[1..100]of integer;
i,j,n:integer;
begin
clrscr;
randomize;
write('nhap n='); readln(n);
for i:=1 to n do
a[i]:=random(4)+1;
for i:=1 to n do write(a[i]:4);
readln;
end.