#include <iostream>
using namespace std;
int a, b, numb;
bool init;
int main()
{
do {
cout << "Input a b: ";
cin >> a >> b;
if ((a > b) || (a <= 0) || (b <= 0))
cout << "Input error! Try again" << endl;
} while ((a > b) || (a <= 0) || (b <= 0));
for (int i = a; i <= b; i++) {
init = true;
numb = i;
if (numb % 10 == 0)
init = false;
else if ((i / (numb % 10) * (numb % 10)) != i)
numb /= 10;
} while (numb != 0);
if (init == true)
cout << i << " ";
}
return 0;
#include <iostream>
using namespace std;
int a, b, numb;
bool init;
int main()
{
do {
cout << "Input a b: ";
cin >> a >> b;
if ((a > b) || (a <= 0) || (b <= 0))
cout << "Input error! Try again" << endl;
} while ((a > b) || (a <= 0) || (b <= 0));
for (int i = a; i <= b; i++) {
init = true;
numb = i;
do {
if (numb % 10 == 0)
init = false;
else if ((i / (numb % 10) * (numb % 10)) != i)
init = false;
numb /= 10;
} while (numb != 0);
if (init == true)
cout << i << " ";
}
return 0;
}