Программа 1 (1082067)
Текст из файла
Задание 1.
На входе 3-х значное число от 100 до 999 в виде строки на английском языке, например: one hundred twenty five. на выходе то же число только цифрами 125 и на староруском языке, в котором 1=А, 2=В, 8=И, 30=Л, 100=Р, 500=Ф.
Листинг программы
function In_StaroRussian(Ch : integer): string;
begin
Result := '';
if Ch - 500 >= 0 then begin
Result := Result + 'Ô';
Ch := Ch - 500;
end;
while Ch >= 100 do begin
Ch := Ch - 100;
Result := Result + 'Ð';
end;
while Ch >= 30 do begin
Ch := Ch - 30;
Result := Result + 'Ë';
end;
while Ch >= 8 do begin
Ch := Ch - 8;
Result := Result + 'È';
end;
while Ch >= 2 do begin
Ch := Ch - 2;
Result := Result + 'Â';
end;
while Ch >= 1 do begin
Ch := Ch - 1;
Result := Result + 'À';
end;
end;
function PerevodChisla(str:string):string;
var
podstroka :string;
proverka, i :integer;
incase : boolean;
begin
podstroka := '';
Result := '';
for i := 1 to length(str) do begin
if str[i] = ' ' then begin
incase := false;
if podstroka = 'twenty' then begin incase := true;
Result := Result + '2';
end;
if podstroka = 'thirty' then begin incase := true;
Result := Result + '3';
end;
if podstroka = 'forty' then begin incase := true;
Result := Result + '4';
end;
if podstroka = 'fifty' then begin incase := true;
Result := Result + '5';
end;
if podstroka = 'sixty' then begin incase := true;
Result := Result + '6';
end;
if podstroka = 'seventy' then begin incase := true;
Result := Result + '7';
end;
if podstroka = 'eighty' then begin incase := true;
Result := Result + '8';
end;
if podstroka = 'ninety' then begin incase := true;
Result := Result + '9';
end;
if podstroka = 'ten' then begin incase := true;
Result := Result + '10';
end;
if podstroka = 'eleven' then begin incase := true;
Result := Result + '11';
end;
if podstroka = 'twelve' then begin incase := true;
Result := Result + '12';
end;
if podstroka = 'thirteen' then begin incase := true;
Result := Result + '13';
end;
if podstroka = 'fourteen' then begin incase := true;
Result := Result + '14';
end;
if podstroka = 'fifteen' then begin incase := true;
Result := Result + '15';
end;
if podstroka = 'sixteen' then begin incase := true;
Result := Result + '16';
end;
if podstroka = 'seventeen' then begin incase := true;
Result := Result + '17';
end;
if podstroka = 'eighteen' then begin incase := true;
Result := Result + '18';
end;
if podstroka = 'nineteen' then begin incase := true;
Result := Result + '18';
end;
if podstroka = 'one' then begin incase := true;
Result := Result + '1';
end;
if podstroka = 'two' then begin incase := true;
Result := Result + '2';
end;
if podstroka = 'thee' then begin incase := true;
Result := Result + '3';
end;
if podstroka = 'four' then begin incase := true;
Result := Result + '4';
end;
if podstroka = 'five' then begin incase := true;
Result := Result + '5';
end;
if podstroka = 'six' then begin incase := true;
Result := Result + '6';
end;
if podstroka = 'seven' then begin incase := true;
Result := Result + '7';
end;
if podstroka = 'eight' then begin incase := true;
Result := Result + '8';
end;
if podstroka = 'nine' then begin incase := true;
Result := Result + '9';
end;
if podstroka = 'hundred' then incase := true;
if incase = false then begin
showmessage('Íàéäåíà îøèáêà â ñëîâå ' + podstroka);
Result := '0';
exit;
end;
podstroka := '';
end
else
podstroka := podstroka + str[i];
end;
if length(result) = 1 then result := result + '00';
if length(result) = 2 then result := result[1] + '0' + result[2];
end;
procedure TForm1.RunClick(Sender: TObject);
var
s:string;
c:integer;
begin
s := Trim(Chislo.text);
s := PerevodChisla(s + ' ');
c := StrToInt(s);
show_chislo.Caption := s;
Res.Text := In_StaroRussian(c);
end;
end.
Скриншоты программы
Характеристики
Тип файла документ
Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.
Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.
Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.