Інформатика9клас.Наступне число Прочитати ціле число та вивести наступне за ним число. Вхідні дані Одне ціле число n, що за модулем не більше 1018 Вихідні дані Вивести число на одиницю більше.
1 задача: //PascalABC.NET var s1,s2,s3:string; m,i,i2:integer; function _case(s:string):integer; begin if s='тысяча' then _case:=1000; if s='девятьсот' then _case:=900; if s='восемьсот' then _case:=800; if s='семьсот' then _case:=700; if s='шестьсот' then _case:=600; if s='пятьсот' then _case:=500; if s='четыреста' then _case:=400; if s='триста' then _case:=300; if s='двести' then _case:=200; if s='сто' then _case:=100; if s='девяносто' then _case:=90; if s='восемьдесят' then _case:=80; if s='семьдесят' then _case:=70; if s='шестьдесят' then _case:=60; if s='пятьдесят' then _case:=50; if s='сорок' then _case:=40; if s='тридцать' then _case:=30; if s='двадцать' then _case:=20; if s='девятнадцать' then _case:=19; if s='восемнадцать' then _case:=18; if s='семнадцать' then _case:=17; if s='шестнадцать' then _case:=16; if s='пятнадцать' then _case:=15; if s='четырнадцать' then _case:=14; if s='тринадцать' then _case:=13; if s='двенадцать' then _case:=12; if s='одиннадцать' then _case:=11; if s='десять' then _case:=10; if s='девять' then _case:=9; if s='восемь' then _case:=8; if s='семь' then _case:=7; if s='шесть' then _case:=6; if s='пять' then _case:=5; if s='четыре' then _case:=4; if s='три' then _case:=3; if s='два' then _case:=2; if s='один' then _case:=1; end; begin Readln(s1); i:=Pos(' ',s1); i2:=Pos(' ',s1,i+1); if i>0 then if i2>0 then begin s2:=copy(s1,i+1,i2-i-1); s3:=copy(s1,i2+1,length(s1)-i2); end else begin s2:=copy(s1,i+1,length(s1)-i); s3:=''; end; delete(s1,i,length(s1)); Writeln(_case(s1)+_case(s2)+_case(s3)); end.
Точнее сказать - чем word отличается от программы Writer из пакета OpenOffice. Word имеет больше функций. Это важно тем, кто много профессионально работает с текстами. Кстати, Word 2010 умеет сохранять в PDF. Зато Writer может читать все форматы Word, а Word не может читать формат Writer - формат .odt. Word - платный. Если сравнивать OpenOffice с Word 2007 и выше, то они отличаются друг от друга совершенно разным расположением кнопочек и панелей. Если ты привык к Word, то тяжело привыкать к OpenOffice. И наоборот. Это я знаю по себе. Но это - дело привычки. Есть целые предприятия, которые перешли но OpenOffice. Еще могу сказать, что Writer дольше запускается. Правда, потом работает без тормозов. Вывод: нельзя сказать, какой лучше. Если для себя - то достаточно OpenOffice поставить, ибо он уже стабильный и по-честному бесплатный.
//PascalABC.NET
var
s1,s2,s3:string;
m,i,i2:integer;
function _case(s:string):integer;
begin if s='тысяча' then _case:=1000; if s='девятьсот' then _case:=900; if s='восемьсот' then _case:=800; if s='семьсот' then _case:=700; if s='шестьсот' then _case:=600; if s='пятьсот' then _case:=500; if s='четыреста' then _case:=400; if s='триста' then _case:=300; if s='двести' then _case:=200; if s='сто' then _case:=100; if s='девяносто' then _case:=90; if s='восемьдесят' then _case:=80; if s='семьдесят' then _case:=70; if s='шестьдесят' then _case:=60; if s='пятьдесят' then _case:=50; if s='сорок' then _case:=40; if s='тридцать' then _case:=30; if s='двадцать' then _case:=20; if s='девятнадцать' then _case:=19; if s='восемнадцать' then _case:=18; if s='семнадцать' then _case:=17; if s='шестнадцать' then _case:=16; if s='пятнадцать' then _case:=15; if s='четырнадцать' then _case:=14; if s='тринадцать' then _case:=13; if s='двенадцать' then _case:=12; if s='одиннадцать' then _case:=11; if s='десять' then _case:=10; if s='девять' then _case:=9; if s='восемь' then _case:=8; if s='семь' then _case:=7; if s='шесть' then _case:=6; if s='пять' then _case:=5; if s='четыре' then _case:=4; if s='три' then _case:=3; if s='два' then _case:=2; if s='один' then _case:=1;
end;
begin
Readln(s1);
i:=Pos(' ',s1);
i2:=Pos(' ',s1,i+1);
if i>0 then if i2>0 then begin s2:=copy(s1,i+1,i2-i-1); s3:=copy(s1,i2+1,length(s1)-i2); end else begin s2:=copy(s1,i+1,length(s1)-i); s3:=''; end;
delete(s1,i,length(s1));
Writeln(_case(s1)+_case(s2)+_case(s3));
end.