// вот тебе решение на паскале, в си сам переделывай function Check(n: integer): boolean; begin result := true; var T := n; while T > 0 do begin if T mod 10 = 0 then //проверка цифры на ноль begin T := T div 10; continue; end; if n mod (T mod 10) = 0 then T := T div 10 else begin result := false; exit; end; end; end;
begin var N := ReadlnInteger('N ='); for var i := 1 to N do if Check(i) then Print(i); end.
Program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; var a, b, c, x, y:integer; begin write('Enter a: '); readLn(a); write('Enter b: '); readLn(b); write('Enter c: '); readLn(c); write('Enter x: '); readLn(x); write('Enter y: '); readLn(y);
writeLn('a^2+(c+b)^2>=10: ', a*a + (c+b)*(c+b) >=10); writeLn('odd(c*(c+1)): ', (c*(c+1)) mod 2 = 1); writeLn('x xor (not y): ', x xor not y); writeLn('(x and y) or not(x): ', (x and y) or not x); readln; end.
function Check(n: integer): boolean;
begin
result := true;
var T := n;
while T > 0 do
begin
if T mod 10 = 0 then //проверка цифры на ноль
begin
T := T div 10;
continue;
end;
if n mod (T mod 10) = 0 then
T := T div 10
else
begin
result := false;
exit;
end;
end;
end;
begin
var N := ReadlnInteger('N =');
for var i := 1 to N do
if Check(i) then Print(i);
end.
{$APPTYPE CONSOLE}
{$R *.res}
uses System.SysUtils;
var a, b, c, x, y:integer;
begin
write('Enter a: ');
readLn(a);
write('Enter b: ');
readLn(b);
write('Enter c: ');
readLn(c);
write('Enter x: ');
readLn(x);
write('Enter y: ');
readLn(y);
writeLn('a^2+(c+b)^2>=10: ', a*a + (c+b)*(c+b) >=10);
writeLn('odd(c*(c+1)): ', (c*(c+1)) mod 2 = 1);
writeLn('x xor (not y): ', x xor not y);
writeLn('(x and y) or not(x): ', (x and y) or not x);
readln;
end.