Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a : array [1..100] of longint;
- n,max1,max2,i,nom1,nom2 : longint;
- begin
- readln(n);
- for i:=1 to n do
- readln(a[i]);
- max1:=a[1];
- nom1:=1;
- for i:=1 to n do
- if a[i]>max1 then begin
- max1:=a[i];
- nom1:=i
- end;
- max2:=a[1];
- nom2:=1;
- for i:=1 to n do
- if a[i]>max2 then begin
- max2:=a[i];
- nom2:=i
- end;
- writeln(nom1);
- writeln(nom2);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement