Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a, b, c, g:Integer;
- i:Char;
- fix, h:int64;
- s:string;
- label 1, 2;
- Begin;
- 2:Readln(s);
- s:=Lowercase(s);
- s:=ReverseString(s);
- for c:= 1 to Length(s) do
- begin
- b:=ordUnicode(s[c])-1071;
- h:=1;
- for g:= 1 to c do
- begin
- h:=h*33;
- end;
- h:=h div 33;
- fix:=fix+(h*b);
- end;
- writeln(fix);
- writeln('Еще одно слово?');
- readln(c);
- if c=1 then goto 2;
- end.
- var
- a, c, g:Integer;
- fix, h, f:Int64;
- label 1;
- Begin
- 1:writeln;
- readln(fix);
- if fix>33 then c:=2;
- if fix>1122 then c:=3;
- if fix>37059 then c:=4;
- if fix>1222980 then c:=5;
- if fix>40358373 then c:=6;
- if fix>1331836342 then c:=7;
- if fix>43950269319 then c:=8;
- if fix>1450358887560 then c:=9;
- if fix>47861843289513 then c:=10;
- if fix>1579440828553962 then c:=11;
- if fix>52121547342280779 then c:=12;
- if fix>1720011062295265740 then c:=13;
- if fix>1420132834615114605 then writeln('Перебор');
- for a:= 0 to (c-1) do
- begin
- h:=1;
- for g:= 1 to (c-a) do
- begin
- h:=h*33;
- end;
- g:=0;
- repeat
- g:=g+1;
- f:=g*(h div 33);
- until(fix-f<(h div 33));
- if g=1 then write('а');
- if g=2 then write('б');
- if g=3 then write('в');
- if g=4 then write('г');
- if g=5 then write('д');
- if g=6 then write('е');
- if g=7 then write('ж');
- if g=8 then write('з');
- if g=9 then write('и');
- if g=10 then write('й');
- if g=11 then write('к');
- if g=12 then write('л');
- if g=13 then write('м');
- if g=14 then write('н');
- if g=15 then write('о');
- if g=16 then write('п');
- if g=17 then write('р');
- if g=18 then write('с');
- if g=19 then write('т');
- if g=20 then write('у');
- if g=21 then write('ф');
- if g=22 then write('х');
- if g=23 then write('ц');
- if g=24 then write('ч');
- if g=25 then write('ш');
- if g=26 then write('щ');
- if g=27 then write('ъ');
- if g=28 then write('ы');
- if g=29 then write('ь');
- if g=30 then write('э');
- if g=31 then write('ю');
- if g=32 then write('я');
- if g=33 then write('ё');
- fix:=fix-g*(h div 33);
- end;
- writeln;
- writeln('Еще одно слово?');
- read(fix);
- if fix = 1 then goto 1;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement