Advertisement
Varvara_Golovnova

Untitled

Aug 30th, 2024
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var
  2. a : array [1..100] of longint;
  3. n,max1,max2,i,nom1,nom2 : longint;
  4. begin
  5. readln(n);
  6. for i:=1 to n do
  7. readln(a[i]);
  8. max1:=a[1];
  9. nom1:=1;
  10. for i:=1 to n do
  11. if a[i]>max1 then begin
  12. max1:=a[i];
  13. nom1:=i;
  14. end;
  15. max2:=a[1];
  16. nom2:=1;
  17. for i:=1 to n do
  18. if a[i]>max2 then begin
  19. max2:=a[i];
  20. nom2:=i;
  21. end;
  22. writeln(nom1);
  23. writeln(nom2);
  24. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement