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