Дано трехзначное число. Найти число единиц в нем, число десятков в нем, число сотен в нем, сумму его цифр, произведение его цифр
Var unitsCount,
tensCount,
hundredsCount,
number : integer;
begin
readln(number);
unitsCount := number mod 10;
tensCount := (number div 10) mod 10;
hundredsCount := number div 100;
writeln(Count of units: , unitsCount);
writeln(Count of tens: , tensCount);
writeln(Count of hundreds: , hundredsCount);
writeln(Sum of digits: , unitsCount + tensCount + hundredsCount);
writeln(Multiplication of digits: , unitsCount * tensCount * hundredsCount);
end.
Оцени ответ
