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