Advertisement
Guest User

Maior e posicao

a guest
Apr 26th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int maior = 0, i, n=0, aux = 0, pos;
  7.  
  8. for(i=0; i<101; i++){
  9. scanf("%d", &n);
  10.  
  11. if(n >= aux){
  12. maior = n;
  13. aux = maior;
  14. pos = i+1;
  15. }
  16.  
  17. }
  18. printf("%d\n", maior);
  19. printf("%d\n", pos);
  20.  
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement