Program z1 var array of integer var max max2 integer Begin for to do r

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Program z1;
var a:array of integer[1..5];
var i,max,max2:integer;
Begin
for i:=1 to 5 do
readln(a[i]);
max = 0;
max2 = 0;
for i:=1 to 5 do
Begin
if a[i] > 0 then
Begin
if a[i] > max2 then
Begin
max2 = a[i];
max = i;
End;
End;
End;
a[max] = 0;
for i:=1 to 5 do
writeln(a[i]);
readln;
End.