Var S:String; W:Array[1..3] of String; i,Nw:Byte; b:boolean; Begin Writeln('Введите числительное прописью; слова разделять ОДНИМ пробелом:'); Readln(S); Nw:=1; For i:=1 to 3 do W[i]:=''; i:=0; Repeat Inc(i); if S[i]<>' ' then W[Nw]:=W[Nw]+S[i] else Inc(Nw); Until i=Length(S); If Nw=1 then begin if W[1]= 'ноль' then write( '0') else if W[1]= 'один' then write( '1') else if W[1]= 'два' then write( '2') else if W[1]= 'три' then write( '3') else if W[1]= 'четыре' then write( '4') else if W[1]= 'пять' then write( '5') else if W[1]= 'шесть' then write( '6') else if W[1]= 'семь' then write( '7') else if W[1]= 'восемь' then write( '8') else if W[1]= 'девять' then write( '9') else if W[1]= 'десять' then write( '10') else if W[1]= 'одиннадцать' then write( '11') else if W[1]= 'двенадцать' then write( '12') else if W[1]= 'тринадцать' then write( '13') else if W[1]='четырнадцать' then write( '14') else if W[1]= 'пятнадцать' then write( '15') else if W[1]= 'шестнадцать' then write( '16') else if W[1]= 'семнадцать' then write( '17') else if W[1]='восемнадцать' then write( '18') else if W[1]='девятнадцать' then write( '19') else if W[1]= 'двадцать' then write( '20') else if W[1]= 'тридцать' then write( '30') else if W[1]= 'сорок' then write( '40') else if W[1]= 'пятьдесят' then write( '50') else if W[1]= 'шестьдесят' then write( '60') else if W[1]= 'семьдесят' then write( '70') else if W[1]= 'восемьдесят' then write( '80') else if W[1]= 'девяносто' then write( '90') else if W[1]= 'сто' then write('100') else if W[1]= 'двести' then write('200') else if W[1]= 'триста' then write('300') else if W[1]= 'четыреста' then write('400') else if W[1]= 'пятьсот' then write('500') else if W[1]= 'шестьсот' then write('600') else if W[1]= 'семьсот' then write('700') else if W[1]= 'восемьсот' then write('800') else if W[1]= 'девятьсот' then write('900'); end else If Nw=2 then begin b:=false; if W[1]= 'сто' then begin b:= true; write('1'); end else if W[1]= 'двести' then begin b:= true; write('2'); end else if W[1]= 'триста' then begin b:= true; write('3'); end else if W[1]= 'четыреста' then begin b:= true; write('4'); end else if W[1]= 'пятьсот' then begin b:= true; write('5'); end else if W[1]= 'шестьсот' then begin b:= true; write('6'); end else if W[1]= 'семьсот' then begin b:= true; write('7'); end else if W[1]= 'восемьсот' then begin b:= true; write('8'); end else if W[1]= 'девятьсот' then begin b:= true; write('9'); end else if W[1]= 'двадцать' then write( '2') else if W[1]= 'тридцать' then write( '3') else if W[1]= 'сорок' then write( '4') else if W[1]= 'пятьдесят' then write( '5') else if W[1]= 'шестьдесят' then write( '6') else if W[1]= 'семьдесят' then write( '7') else if W[1]= 'восемьдесят' then write( '8') else if W[1]= 'девяносто' then write( '9'); if W[2]= 'десять' then write('10') else if W[2]= 'одиннадцать' then write('11') else if W[2]= 'двенадцать' then write('12') else if W[2]= 'тринадцать' then write('13') else if W[2]='четырнадцать' then write('14') else if W[2]= 'пятнадцать' then write('15') else if W[2]= 'шестнадцать' then write('16') else if W[2]= 'семнадцать' then write('17') else if W[2]='восемнадцать' then write('18') else if W[2]='девятнадцать' then write('19') else if W[2]= 'двадцать' then write('20') else if W[2]= 'тридцать' then write('30') else if W[2]= 'сорок' then write('40') else if W[2]= 'пятьдесят' then write('50') else if W[2]= 'шестьдесят' then write('60') else if W[2]= 'семьдесят' then write('70') else if W[2]= 'восемьдесят' then write('80') else if W[2]= 'девяносто' then write('90') else if W[2]= 'один' then begin if b then write('01') else write('1') end else if W[2]= 'два' then begin if b then write('02') else write('2') end else if W[2]= 'три' then begin if b then write('03') else write('3') end else if W[2]='четыре' then begin if b then write('04') else write('4') end else if W[2]= 'пять' then begin if b then write('05') else write('5') end else if W[2]= 'шесть' then begin if b then write('06') else write('6') end else if W[2]= 'семь' then begin if b then write('07') else write('7') end else if W[2]='восемь' then begin if b then write('08') else write('8') end else if W[2]='девять' then begin if b then write('09') else write('9') end; end else begin if W[1]= 'сто' then write('1') else if W[1]= 'двести' then write('2') else if W[1]= 'триста' then write('3') else if W[1]= 'четыреста' then write('4') else if W[1]= 'пятьсот' then write('5') else if W[1]= 'шестьсот' then write('6') else if W[1]= 'семьсот' then write('7') else if W[1]= 'восемьсот' then write('8') else if W[1]= 'девятьсот' then write('9'); if W[2]= 'двадцать' then write('2') else if W[2]= 'тридцать' then write('3') else if W[2]= 'сорок' then write('4') else if W[2]= 'пятьдесят' then write('5') else if W[2]= 'шестьдесят' then write('6') else if W[2]= 'семьдесят' then write('7') else if W[2]= 'восемьдесят' then write('8') else if W[2]= 'девяносто' then write('9'); if W[3]= 'один' then write('1') else if W[3]= 'два' then write('2') else if W[3]= 'три' then write('3') else if W[3]= 'четыре' then write('4') else if W[3]= 'пять' then write('5') else if W[3]= 'шесть' then write('6') else if W[3]= 'семь' then write('7') else if W[3]= 'восемь' then write('8') else if W[3]= 'девять' then write('9'); end; Readln End.