.



2

2

1-

Program Task2_2;

uses WinCrt;

var

n, p, n1 : longint;

begin

write(' n '); readln(n);

n1 := 0;

while n > 0 do

begin

p := n mod 10;

n1 := n1*10 + p;

n := n div 10

end;

writeln(', ', n1 + n)

end.

2-

Program Task2_2a;

uses WinCrt;

var

n, p, n1 : longint;

begin

write(' '); readln(n);

n1 := 0;

while n > 0 do

begin

n1 := n1*10 + n mod 10;

n := n div 10

end;

writeln(', ', n1)

end.

3

2

Program Task3_2;

uses WinCrt;

var

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

begin

write(' 28 '); readln(a);

b := 100;

writeln(' , ');

write(' ', a, ' : ');

while b < 1000 do

begin

s := 0; n := b;

while n <> 0 do

begin

p := n mod 10;

s := s + p;

n := n div 10

end;

if s = a then write(b, ', ');

b := b + 1

end; writeln

end.

3

Program Task3_3;

uses WinCrt;

var

n, d, e : integer;

begin

n := 10;

write(' ');

while n <= 99 do

begin

d := n div 10; e := n mod 10;

if n + d*d*d + e*e*e = e*10 + d then

writeln(n);

n := n + 1

end

end.

4

Program Task4;

uses WinCrt;

var

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

begin

write(' '); readln(a);

b := 1;

writeln(' , ');

write(' ', a, ' : ');

while b < 32767 do

begin

s := 0; n := b;

while n <> 0 do

begin

p := n mod 10; s := s + p; n := n div

10

end;

if s = a then write(b, ', ');

b := b + 1

end; writeln

end.