An array of N natural numbers is given. Indicate those numbers, the remainder of which division by M is equal to L (0 ≤ L ≤ M-1).
#include "stdafx.h" #include <iostream> #include <math.h> #include <stdio.h> #include <cstdlib> #include <locale.h> using namespace std; int main() { int n=15, k=0, i,m1, m, l; int b[15],A[15]; k=0; m1=0; cout<<"vvedite m и l"; cin>>m; cin>>l; for (i = 0; i < n; i++) { cout << "A[" << i << "] = "; cin >> A[i]; } for (i = 0; i < n; i++) { l=A[i]%m; if ((0<=l)&&(l<=(m-1))) { b[k]=i; cout <<"b["<<k<<"]="<<b[k]<<endl; k++; } } system("pause"); return 0; }