Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- int n = 0;
- std::cin >> n;
- if (n <= 0) {
- std::cout << "ERROR: An array is empty.";
- return 0;
- }
- int x = 0;
- std::cin >> x;
- int cur_min = x;
- for (int i = 1; i < n; ++i) {
- std::cin >> x;
- if (x < cur_min) cur_min = x;
- }
- std::cout << cur_min;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement