#include <iostream> #include <conio.h>
using namespace std;
void main() { int count = 0; const int N = 50; int mass[N] = {0}; int mass2[N] = {0}; int max; cout<<"Vvedite kol-vo elementov :"; cin>>max; cout<<endl; for (int i = 0; i<max; i++) { cout<<"Input element "<<i<<" : "; cin>>mass[i]; cout<<endl; } int k,u,flag; for (int i = 0;i<max;i++) { u = mass[i]; flag = 0; while (u != 0) { k = u%10; u = u/10; if (k != 0 && k != 1) { if (mass[i] % k == 0 && mass[i]<10000) { flag = 1; mass2[i] = mass[i]; } } } if (flag == 1) { count++; } } cout<<"=================="<<endl; cout<<"spisok elementov"<<endl; for (int i = 0; i<max;i++) { if (mass2[i] != 0) { cout<<mass2[i]<<endl; } } cout<<"Kolichestvo"<<endl; cout<<count;
getch(); }
|