.



 

1

 

Program Task1;

uses WinCrt;

var

n, a, k : integer;

begin

n := 131;

repeat

n := n + 131;

a := n; k := 0;

repeat

k := k + 1;

a := a div 10

until a = 0;

until k mod 2 = 0;

writeln(' , 131');

writeln(' ', n)

end.

 

2

 

Program Task2_2;

uses WinCrt;

var

a, n, p, s : integer;

begin

a := 100;

writeln(' , 11');

write(' ');

repeat

n := a; s := 0;

repeat

p := n mod 10;

s := s + p*p;

n := n div 10

until n = 0;

if (a mod 11 = 0) and (s = a div

11) then write(a, '; ');

a := a + 1

until a = 1000;

end.

 

4

Program

Task4; { . 1 - }

uses WinCrt;

var

a, b, m, n, p : integer;

begin

write(' '); readln(a);

write(' '); readln(b);

p := 0;

repeat

if a>b then

begin

m := a; n := b

end

else

begin

m := b; n := a

end;

p := p + m

until p mod n =0;

writeln(' ', a, ' ', b, ' ', p)

end.

5

Program

Task5; { ? 2- }

uses WinCrt;

label 1, 2;

var

n, i : integer;

begin

write(' '); readln(n);

i := 3;

if n = 2 then writeln(' ', n, ' - ')

else if n = 3

then writeln(' ', n, ' - ')

else

if n mod 2 = 0 then

writeln(' ',n,' ')

else

repeat

if

n mod i = 0 then goto 1;

i := i + 2

until

i > n div 2;

writeln(' ', n, ' '); goto 2;

1: writeln(' ', n, ' ');

2: end.