1)vara,b,sum : integer;beginReadln(a, b);if (a mod b = 0) then begin while a > 0 do begin sum:= sum + (a mod 10); a:= a div 10; end; if sum > b then begin Writeln('Верно'); halt; end; end;Writeln('Неверно');end.Пример:1234 2Верно2)vari: integer;beginFor i:= 100 to 999 do if (i*i)mod 1000 = i then Write(i, ' ');end.Результат:376 625 3)vari,n : integer;function Simple(n: Longint): boolean;var i: Longint;begin for i := 2 to Round(Sqrt(n)) do if n mod i = 0 then break; Simple := n mod i <> 0;end;begin Read(n); For i:= 1 to Round(Sqrt(n)) do if n mod i = 0 then if (Simple(i))and(Simple(n div i)) then begin Writeln('YES'); halt; end; Writeln('NO');end.
Пример:33YES