program Chislo;
var Number,Sum,Digits,Product:longint;
{Считывание числа}
procedure input(var Number:longint);
begin
writeln('Input Number');
readln(Number);
end;
{Вычисление количества цифр}
function calDigits(Number:longint):longint;
begin
Digits:=0;
repeat
while Number <> 0 do
begin
Number:=(Number div 10);
Inc(Digits);
calDigits:=Digits;
end;
until Number = 0;
if Number = 0 then calDigits:=1;
end;
{Вычисление суммы цифр}
function calSum(Number:longint):longint;
begin
Sum:=0;
repeat
while Number <> 0 do
begin
Number:=(Number mod 10);
Sum:=Number + Sum;
calSum:=Sum;
end;
until Number = 0;
if Number = 0 then calSum:=0;
end;
{Произведение цифр}
function calProduct(Number:longint):longint;
begin
Product:=1;
repeat
while Number <> 0 do begin
Number:=(Number mod 10);
Product:=Number * Product;
calProduct:=Product;
end;
until Number = 0;
if Number = 0 then calProduct:=0;
end;
{Вывод данных}
procedure output(Number,Digits,Sum,Product:longint);
begin
writeln('NUMBER: ',Number);
writeln('DIGITS: ',Digits);
writeln('SUM: ', Sum);
writeln('PRODUCT: ',Product);
end;
begin
input(Number);
Digits:=calDigits(Number);
Sum:=calSum(Number);
Product:=calProduct(Number);
output(Number,Digits,Sum,Product);
end.
cHJvZ3JhbSBDaGlzbG87CnZhciBOdW1iZXIsU3VtLERpZ2l0cyxQcm9kdWN0OmxvbmdpbnQ7Cgp70KHRh9C40YLRi9Cy0LDQvdC40LUg0YfQuNGB0LvQsH0KcHJvY2VkdXJlIGlucHV0KHZhciBOdW1iZXI6bG9uZ2ludCk7CmJlZ2luCiAgd3JpdGVsbignSW5wdXQgTnVtYmVyJyk7CiAgcmVhZGxuKE51bWJlcik7CmVuZDsKCnvQktGL0YfQuNGB0LvQtdC90LjQtSDQutC+0LvQuNGH0LXRgdGC0LLQsCDRhtC40YTRgH0KZnVuY3Rpb24gY2FsRGlnaXRzKE51bWJlcjpsb25naW50KTpsb25naW50OwpiZWdpbgogIERpZ2l0czo9MDsKICByZXBlYXQKICAgIHdoaWxlIE51bWJlciA8PiAwIGRvCi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