Advertisement
myloyo

6.2.15

Nov 28th, 2022 (edited)
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 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 minim = 100000000000000000;
  13.     double* a = new double[n];                        
  14.     for (int i = 0; i < n; i++) {
  15.         cin >> a[i];
  16.         if ((a[i] >= 0) && (a[i] < minim)) {
  17.             minim = a[i];
  18.         }
  19.     }
  20.     cout << minim;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement