Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int n, a1, a2, x, max, b, c;
  5. scanf("%d%d", &n, &a1);
  6. max = a1;
  7. b = 1;
  8. c = 1;
  9. for(x = 1; x<n; x++){
  10. b++;
  11. scanf("%d", &a2);
  12. if(a2 >= max){
  13. max = a2;
  14. c = b;
  15. }
  16. a1 = a2;
  17. }
  18. printf("%d", c);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement