srand(time(0));
const int size = 10;
int A[size]{};
for (size_t i = 0; i < size; i++)
{
cout << endl;
int index_3 = 0;
int index_5 = 0;
int index_7 = 0;
for (size_t i = 0; i < size; i++)
{
cout << "3 fold - " << index_3 << endl
const int size = 10;
int A[size]{};
for (size_t i = 0; i < size; i++)
{
A[i] = rand() % 101;}
cout << A[i] << "\t";
cout << endl;
int index_3 = 0;
int index_5 = 0;
int index_7 = 0;
for (size_t i = 0; i < size; i++)
{
if (A[i] % 3 == 0)}
index_3++;if (A[i] % 5 == 0)
index_5++;if (A[i] % 7 == 0)
index_7++;
cout << "3 fold - " << index_3 << endl
<< "5 fold - " << index_5 << endlsystem("pause");
<< "7 fold - " << index_7 << endl;
Комментариев нет:
Отправить комментарий