#include <iostream>
#include <iomanip>
#include <windows.h>
using namespace std;
int main() {
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int n, x, max;
cout << "Введите количество чисел" << endl;
cin >> n;
if (n <= 0) {
cout << "нет чисел" << endl;
}
else {
cout << "Введите число" << endl;
cin >> x;
max = x;
for (int i = 1; i < n; i++) {
cout << "Введите число" << endl;
cin >> x;
if (x > max) {
max = x;
}
}
cout << "Максимальное: " << max << endl;
}
return 0;
}
#include <iostream>
#include <iomanip>
#include <windows.h>
using namespace std;
int main() {
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int n, max;
cout << "Введите число" << endl;
cin >> n;
if (n == 0) {
cout << "нет чисел" << endl;
}
else {
max = n;
while (n != 0) {
cout << "Введите число" << endl;
cin >> n;
if (n != 0 && n > max) {
max = n;
}
}
cout << "Максимальное: " << max << endl;
}
return 0;
}