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