Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void func(int &s, int x=1000000000){
  4. if (x<=s)
  5. s=x;
  6. }
  7.  
  8. int main() {
  9. int s=1000000000, x, n;
  10. cin >> n;
  11. for(int i=0; i<n; i++){
  12. cin >> x;
  13. if (i<=n) func(s, x);
  14. else func(s);
  15. }
  16. cout << s;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement