Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n, a;
- bool f;
- double x, mx;
- int main()
- {
- cin >> n;
- mx = double(0);
- f = false;
- for (int i = 0 ; i < n ; i++)
- {
- cin >> x;
- if (x > mx)
- {
- mx = x;
- a = i + 1;
- }
- if (x > 1)
- {
- cout << i + 1 << " ";
- f = true;
- }
- }
- if (f == false)
- cout << a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement