#include <iostream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main(){
setlocale(LC_ALL, "Russian");
srand(time (NULL));
const int N=18;
int array[N];
int Index;
int i;
for(i=0;i<N;i++)
{
array[i]=rand()%50;
cout<< setw(5) <<array[i];
}
cout << endl;
cout<<"Числа которые кратны:";
for(i=0;i<N;i++)
{
if(array[i] % 12 == 0 )
{
Index=i;
cout << setw(5) << array[i] ;
}
}
cout << endl;
cout<< "Номер массива:";
for(i=0;i<N;i++)
{
if(array[i] % 12 == 0 )
{
Index=i;
cout << setw(5) << Index;
}
}
cout << endl;
return 0;
}
for n := min to max do begin end;
Объяснение:
Если это Паскаль, то: где n := min - установка значения, с которого будет начинаться цикл, max - до какого значения будет идти цикл, вместо этих min и max можно поставить свои значения. После do идет оператор