Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int n, a;
  4. bool f;
  5. double x, mx;
  6. int main()
  7. {
  8. cin >> n;
  9. mx = double(0);
  10. f = false;
  11. for (int i = 0 ; i < n ; i++)
  12. {
  13. cin >> x;
  14. if (x > mx)
  15. {
  16. mx = x;
  17. a = i + 1;
  18. }
  19. if (x > 1)
  20. {
  21. cout << i + 1 << " ";
  22. f = true;
  23. }
  24. }
  25. if (f == false)
  26. cout << a;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement