fork download
  1. program n_4;
  2. var i, imax: integer;
  3. a: array[1..10] of integer;
  4. begin
  5. randomize;
  6.  
  7. for i:=1 to 10 do a[i]:=random(100);
  8. for i:=1 to 10 do write(a[i],' ');
  9.  
  10. imax:=1;
  11.  
  12. for i:=2 to 10 do
  13. if a[i]>a[imax] then
  14. imax:=i;
  15.  
  16. write('Наибольший элемент a[', imax, ']=', a[imax])
  17.  
  18. end.
Success #stdin #stdout 0s 4512KB
stdin
Standard input is empty
stdout
84 76 82 7 96 68 32 65 21 58 Наибольший элемент   a[5]=96