Quick actions

cmd+k|ctrl+k

Navigation

Languages

52

Snippet info

Language

Cpp

Visibility

public

Author

nxnxngh

Created

2018-11-11T17:32:15Z

Updated

2018-11-26T17:18:16Z

#include <iostream>
#include <cmath>
#include <ctime>
using namespace std;

int main() {
	setlocale(LC_ALL, "ru");
	srand(time(NULL));
	int size = rand()%10,M = 0, L = 0,K=0,count;
	int *mass = new int[size];
	cout << "size = " << size << endl;
	for (int i = 0; i < size; i++)
	{
		mass[i] = rand() % 20;
		cout << mass[i] << "\t";
	}
	cout << endl << "input limit elements" << endl;
		cin >> M >> L;
	cout << endl << "input a digit" << endl;
		cin >> K;
		count = 0;
		for (M; M <= L; M++)
		{
			if (mass[M] % K == 0)
				count++;
		}
		cout << "Digits thats kratnuy " << K << "\t" << count<<endl;
		delete mass;
		system("PAUSE");
	return 0;
}
INFO