Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int n;
- std::cin >> n;
- int low = INT_MAX;
- int max = INT_MIN;
- for (int i = 0; i < n; i++)
- {
- int num;
- std::cin >> num;
- if (num > max)
- {
- max = num;
- }
- else
- {
- low = num;
- }
- std::cout << "Max number: " << max << '\n';
- std::cout << "Min number: " << low << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement