program p_3655 var max_1 max_2 longint Begin read max_1 -2147483646 ma

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
program p_3655;
var a,t,max_1,max_2 :longint;
Begin
read (a);
max_1:=-2147483646;
max_2:=0;
while a<>0 do
begin
if max_1<a then
begin
max_2:=max_1;
max_1:=a;
end;
if max_1 > a then
if max_2 < a then
begin
if a<>0 then
begin
max_2:=a;
end;
end;
read (a);
end;
if max_2 > max_1 then
t:=max_1;
max_1:=max_2;
max_2:=t;
write (max_2);
end.