#include <iostream>
#include <time.h>
using namespace std;
int main()
{
srand(time(NULL));
setlocale(LC_CTYPE, "Russian");
int a[4], max;
cout << "Массив: ";
for (int i = 0; i < 4; i++)
a[i] = -5 + rand() % 50;
cout << a[i] << " ";
}
max = a[0];
for (int i = 1; i < 4; i++)
if (a[i] > max)
max = a[i];
cout <<endl<< "Макс.эл. - " << max;
return 0;
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
srand(time(NULL));
setlocale(LC_CTYPE, "Russian");
int a[4], max;
cout << "Массив: ";
for (int i = 0; i < 4; i++)
{
a[i] = -5 + rand() % 50;
cout << a[i] << " ";
}
max = a[0];
for (int i = 1; i < 4; i++)
{
if (a[i] > max)
{
max = a[i];
}
}
cout <<endl<< "Макс.эл. - " << max;
return 0;
}