Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by slwpkr ( 15 years ago )
program HelloWorld;
const N = 30;
var
  A    : array[1..N] of integer;
  max1, max2 : integer;
begin
for i := 1 to N do
 readln(A[i]);

max1 := A[1];
for i := 2 to N do begin
 if(A[i] > max1) then max1 := A[i];
end;

max2 := A[1];
for i := 2 to N do begin
 if(A[i] < max2 and max1 = max2) then max2 = A[i];
 if(A[i] > max2 and A[i] < max1) then max2 := A[i];
end;

end.

 

Revise this Paste

Parent: 39282
Children: 39284
Your Name: Code Language: