Determine all possible positive integers, two or more digits long, like ABC...XYZ, such that ABC...XY0Z is a multiple of it.
Note: digits may be repeated.
//If Brute-Force is the only approach, following C++
//program should help.
int i=10; //starting with a positive non-zero two digit number
int lastdigit=i mod 10; //last digit of number i
int divident= (i-lastdigit) * 10 + lastdigit;
//the bigger number (ABC...XY0Z)
while (true)
{
if (lastdigit mod i == 0)
cout<<i<<";"<<lastdigit<<"\n";
i++;
lastdigit=i mod 10;
divident= (i-lastdigit) * 10 + lastdigit;
}