Write a program that enters a natural number N and prints on the screen all natural numbers not exceeding N and divisible by each of their digits.
We write the program:
var i, n, k, f: integer;
writeln (‘Vvedite n:’); readln (n);
for i: = 1 to n do
k: = i; f: = 0;
while (k <> 0) do
if (k mod 10> 0) and (i mod (k mod 10)> 0) then f: = 1;
k: = k div 10;
if (f = 0) and (i mod 10> 0) then write (i, ”);
The program has been written.
One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.