setlocale(LC_ALL, "Russian");
const int size = 50;
int A[size];
srand(time(NULL));
for (int i = 0; i<size; i++)
int tmp_l = 1;
int b = 0;
int tmp_b = 0;
int i;
for (i = 1; i<size; ++i)
{
cout << "\n\n\n";
for (int i = b; i<b + l; i++)
const int size = 50;
int A[size];
srand(time(NULL));
for (int i = 0; i<size; i++)
A[i] = rand() % 999 + 0;for (int i = 0; i<size; i++)
cout << i << " - " << A[i] << "\n";int l = 0;
int tmp_l = 1;
int b = 0;
int tmp_b = 0;
int i;
for (i = 1; i<size; ++i)
{
if (A[i] >= A[i - 1])}tmp_l++;else
{if (tmp_l>l)}
{l = tmp_l;}
b = tmp_b;
tmp_b = i;
tmp_l = 1;
cout << "\n\n\n";
for (int i = b; i<b + l; i++)
cout << i << " - " << A[i] << "\n";
Комментариев нет:
Отправить комментарий