Другие языки программирования и технологии

. Ввести с клавиатуры число и вывести его значение словами (например, 44 - сорок четыре) (число от 1 до 50).

Вот программа выведет словами число от 1 до 99:
program chislo;
Var
s,t:string;
begin
readln(s);
t:='';
if length(s)=1 then
begin
if s[1]= '1' then t:='один ';
if s[1]= '2' then t:='два ';
if s[1]= '3' then t:='три ';
if s[1]= '4' then t:='четыре ';
if s[1]= '5' then t:='пять ';
if s[1]= '6' then t:='шесть ';
if s[1]= '7' then t:='семь ';
if s[1]= '8' then t:='восемь ';
if s[1]= '9' then t:='девять ';
end

else begin
if s[1]= '2' then t:=t+'двадцать ';
if s[1]= '3' then t:=t+'тридцать ';
if s[1]= '4' then t:=t+'сорок ';
if s[1]= '5' then t:=t+'пятьдесят ';
if s[1]= '6' then t:=t+'шестьдесят ';
if s[1]= '7' then t:=t+'семьдесят ';
if s[1]= '8' then t:=t+'восемьдесят ';
if s[1]= '9' then t:=t+'девяносто ';

if s[1]= '1' then begin
if s[2]= '0' then t:=t+'десять ';
if s[2]= '1' then t:=t+'одиннадцать ';
if s[2]= '2' then t:=t+'двенадцать ';
if s[2]= '3' then t:=t+'тринадцать ';
if s[2]= '4' then t:=t+'четырнадцать ';
if s[2]= '5' then t:=t+'пятнадцать ';
if s[2]= '6' then t:=t+'шестнадцать ';
if s[2]= '7' then t:=t+'семнадцать ';
if s[2]= '8' then t:=t+'восемнадцать ';
if s[2]= '9' then t:=t+'девятнадцать ';
end;
if s[1]<> '1' then begin
if s[2]= '1' then t:=t+'один ';
if s[2]= '2' then t:=t+'два ';
if s[2]= '3' then t:=t+'три ';
if s[2]= '4' then t:=t+'четыре ';
if s[2]= '5' then t:=t+'пять ';
if s[2]= '6' then t:=t+'шесть ';
if s[2]= '7' then t:=t+'семь ';
if s[2]= '8' then t:=t+'восемь ';
if s[2]= '9' then t:=t+'девять ';
end;
end;
writeln(t);

End.
Сергей Соколов
Сергей Соколов
56 353
Лучший ответ
Долгвато такую прогу делать.. . за рублей 50 бы сделал
ДД
Дима Димасик
12 964

Похожие вопросы