.


longint


- .

, integer -32768 32767, longint -2147483648 2147483647.

, longint, .

:

Program

Problem1; { . }

uses WinCrt;

var

n, p, i : longint;

begin

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

i := 1;

while n <> 0 do

begin

p := n mod 10;

writeln(i, ' - ', p);

n := n div 10;

i := i+1

end

end.

Program Sum; { }

uses WinCrt;

var

a, n, s, p : longint;

begin

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

a := n; s := 0;

while n <> 0 do

begin

p := n mod 10; { }

s := s + p; { }

n := n div 10

end;

writeln(' ', a, ' ', s)

end.

Program

Problem2a; { . }

uses WinCrt;

var

n, n1, p, a, i : longint;

begin

write(' . n <= 2147483647 ');

readln(n);

a := n;

i := 1;

p := n mod 10; { }

while n >= 10 do

begin

i := i*10;

n := n div 10;

end;

n1 := a - n*i - p + n + p*i;

writeln(' ', n1);

end.

.

, , . , .