написать программу поиска значения максимального элемента массива
Answers & Comments
BlackW1nd
Const n=10; Var a:array[1..n] of integer; i,max:integer; Begin randomize; for i:=1 to n do a[i]:=random(201)-100; for i:=1 to n do write(a[i],' '); writeln; max:=a[1]; for i:=2 to n do if a[i]>max then max:=a[i]; writeln('max=',max); End.
Answers & Comments
Var a:array[1..n] of integer; i,max:integer;
Begin
randomize;
for i:=1 to n do a[i]:=random(201)-100;
for i:=1 to n do write(a[i],' ');
writeln;
max:=a[1];
for i:=2 to n do
if a[i]>max then max:=a[i];
writeln('max=',max);
End.