Advertisement
awsmpshk

Untitled

Dec 27th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n;
  8. cin >> n;
  9. int* a = new int[n];
  10. for (int i = 0; i < n; ++i) {
  11. cin >> a[i];
  12. }
  13. int mn = 1e9;
  14. for (int i = 0; i < n; ++i) {
  15. if (a[i] < mn && a[i] > 0) mn = a[i];
  16. }
  17. cout << mn << endl;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement