Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int n, a1, a2, x, max, b, c;
- scanf("%d%d", &n, &a1);
- max = a1;
- b = 1;
- c = 1;
- for(x = 1; x<n; x++){
- b++;
- scanf("%d", &a2);
- if(a2 >= max){
- max = a2;
- c = b;
- }
- a1 = a2;
- }
- printf("%d", c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement