srand(time(0));
const int size = 50;
int A[size]{};
for (size_t i = 0; i < size; i++)
{
int begin;
int end;
int digit;
cout << "Enter begin range:";
cin >> begin;
cout << "Enter end range:";
cin >> end;
cout << "Enter digit:";
cin >> digit;
int i = begin;
for (; i < end; i++) {
if (i == end)
const int size = 50;
int A[size]{};
for (size_t i = 0; i < size; i++)
{
A[i] = rand() % 200 - 99;}
cout << A[i] << "\t";
if ((i + 1) % 10 == 0)
cout << endl;
int begin;
int end;
int digit;
cout << "Enter begin range:";
cin >> begin;
cout << "Enter end range:";
cin >> end;
cout << "Enter digit:";
cin >> digit;
int i = begin;
for (; i < end; i++) {
if (A[i] == digit) {}
cout << "Digit is found! " << i << " element in range" << endl;}
break;
if (i == end)
cout << "Digit not found in range" << endl;system("pause");
Комментариев нет:
Отправить комментарий