Răspuns :
#include<iostream.h>
unsigned n, m, a, q=0;
void main()
{
cout<<"n="; cin>>n;
cout<<"m="; cin>>m;
while(n)
{
a=n%10;
if(m%a==0)
q++;
n=n/10;
}
cout<<q;
}
unsigned n, m, a, q=0;
void main()
{
cout<<"n="; cin>>n;
cout<<"m="; cin>>m;
while(n)
{
a=n%10;
if(m%a==0)
q++;
n=n/10;
}
cout<<q;
}