Var A:array[1..15]of integer; i:integer; Begin Write('До: '); For i:= 1 to 15 do Begin A[i]:=random(15)+1; Write(A[i],' '); if A[i] mod 3 = 0 then A[i]:=0 End; WriteLn; Write('После: '); For i:= 1 to 15 do Write(A[i],' ') End.
Program al; const n=15; var a:array[1..n] of integer; i:integer; procedure zam; begin for i := 1 to n do if a[i] mod 3=0 then a[i]:=0; end; begin writeln('vvedite massiv='); for i:=1 to n do readln(a[i]); zam; writeln('noviy massiv='); for i := 1 to n do write (a[i]:4); readln; end.
A:array[1..15]of integer;
i:integer;
Begin
Write('До: ');
For i:= 1 to 15 do
Begin
A[i]:=random(15)+1;
Write(A[i],' ');
if A[i] mod 3 = 0 then A[i]:=0
End;
WriteLn;
Write('После: ');
For i:= 1 to 15 do
Write(A[i],' ')
End.
const n=15;
var a:array[1..n] of integer;
i:integer;
procedure zam;
begin
for i := 1 to n do
if a[i] mod 3=0
then
a[i]:=0;
end;
begin
writeln('vvedite massiv=');
for i:=1 to n do
readln(a[i]);
zam;
writeln('noviy massiv=');
for i := 1 to n do
write (a[i]:4);
readln;
end.