В c++
#include
int main()
{
using namespace std;
unsigned long int N;
cout << "Enter natural number: ";<br> cin >> N;
for (int i = 1; i < N; i++)
{
int j = i;
while (j % 10 != 0 && i % (j % 10) == 0)
j = j / 10;
if (j == 0)
cout << i << " ";<br> }
cout << endl;<br> return 0;
}