Advertisement
myloyo

6.2.6

Nov 28th, 2022 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <algorithm>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int n;
  11.     cin >> n;
  12.     double maxim = -100000000000000000;
  13.     double* a = new double[n];                        
  14.     for (int i = 0; i < n; i++) {
  15.         cin >> a[i];
  16.         if (a[i] > maxim) {
  17.             maxim = a[i];
  18.         }
  19.     }
  20.     for (int i = 0; i < n; i++) {
  21.         if (a[i] != maxim) {
  22.             cout << i+1 << " ";
  23.         }
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement