program cyberforum;
var
a,b: array[1..20] of integer;
i: integer;
begin
randomize;
write('массив a: ');
for i: =1 to 20 do begin
a[i]: =random(5)+1;
write(a[i],' ');
end;
writeln;
write('массив b: ');
b[i]: =random(5)+1;
write(b[i],' ');
if a[i]=b[i] then
writeln(i,' элемент, значение: ',a[i]);
end.
program cyberforum;
var
a,b: array[1..20] of integer;
i: integer;
begin
randomize;
write('массив a: ');
for i: =1 to 20 do begin
a[i]: =random(5)+1;
write(a[i],' ');
end;
writeln;
write('массив b: ');
for i: =1 to 20 do begin
b[i]: =random(5)+1;
write(b[i],' ');
end;
writeln;
for i: =1 to 20 do begin
if a[i]=b[i] then
writeln(i,' элемент, значение: ',a[i]);
end;
end.