<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95583</guid>
        <pubDate>Thu, 11 Jul 2002 09:02:17 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95583</link>
        <description><![CDATA[zheromo: Вот еще один сорец на пасе:<br><br>---cut here<br><br>type<br><br> &nbsp;str3 = string[3];<br> &nbsp;ind9 = '0'..'9';<br><br> &nbsp;tsex = ( _, female, male );<br><br> &nbsp;irec = record s:string[12]; sex:tsex end;<br><br>const<br><br> &nbsp; &nbsp; k_o : array[tsex,ind9] of string[2] = (<br> &nbsp; &nbsp; &nbsp; ('','','','','','','','','',''),<br> &nbsp; &nbsp; &nbsp; ('','а','и','и','и','','','','',''),<br> &nbsp; &nbsp; &nbsp; ('ов','','а','а','а','ов','ов','ов','ов','ов')<br> &nbsp; &nbsp; );<br><br> &nbsp; &nbsp; k_table : array[1..4] of irec = (<br> &nbsp; &nbsp; &nbsp; (s:'';sex:_),<br> &nbsp; &nbsp; &nbsp; (s:'тысяч';sex:female),<br> &nbsp; &nbsp; &nbsp; (s:'миллион';sex:male),<br> &nbsp; &nbsp; &nbsp; (s:'миллиард';sex:male)<br> &nbsp; &nbsp; );<br><br><br> &nbsp; &nbsp; _tab : array [0..3,ind9] of string[12] = (<br> &nbsp; &nbsp; &nbsp; ('десять','одиннадцать','двеннадцать','тринадцать','четырнадцать','пятнадцать',<br> &nbsp; &nbsp; &nbsp; 'шестнадцать','семнадцать','восемнадцать','девятнадцать'),<br> &nbsp; &nbsp; &nbsp; ('','од','дв','три','четыре','пять','шесть','семь','восемь','девять'),<br> &nbsp; &nbsp; &nbsp; ('','десять','двадцать','тридцать','сорок','пятьдесят','шестьдесят','семьдесят','восемьдесят','девяносто'),<br> &nbsp; &nbsp; &nbsp; ('','сто','двести','триста','четыреста','пятьсот','шестьсот','семьсот','восемьсот','девятьсот')<br> &nbsp; &nbsp; );<br><br><br>procedure irecw(b:boolean;k:byte;i:ind9);<br>begin<br> &nbsp;write(' ',k_table[k].s);<br> &nbsp;if b then<br> &nbsp; &nbsp;write(k_o[k_table[k].sex,i])<br> &nbsp;else if k_table[k].sex=male then<br> &nbsp; &nbsp;write('ов')<br>end;<br><br>function ireco(b:boolean;k:byte;i:ind9):boolean;<br>begin<br> &nbsp;if b then<br> &nbsp; &nbsp;case i of<br> &nbsp; &nbsp; &nbsp;'1': if k=2 then write('на') else write('ин');<br> &nbsp; &nbsp; &nbsp;'2': if k=2 then write('е') else write('а');<br> &nbsp; &nbsp;end;<br> &nbsp;ireco:=b<br>end;<br><br><br>procedure tetr(k,o:byte;s:str3);<br><br> &nbsp;function _tetr(o,i:byte):boolean;<br> &nbsp;begin<br> &nbsp; &nbsp;if boolean(o) then<br> &nbsp; &nbsp; &nbsp;if (o=2) and (s[i]='1') then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;write(' ',_tab[0,s[i+1]]);<br> &nbsp; &nbsp; &nbsp; &nbsp;_tetr:=false<br> &nbsp; &nbsp; &nbsp;end else begin<br> &nbsp; &nbsp; &nbsp; &nbsp;write(' ',_tab[o,s[i]]);<br> &nbsp; &nbsp; &nbsp; &nbsp;_tetr:=_tetr(o-1,i+1);<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp;_tetr:=true<br> &nbsp;end;<br><br>begin<br> &nbsp;if s='000' then exit;<br> &nbsp;irecw(ireco(_tetr(o,1),k,s[o]),k,s[o]);<br>end;<br><br>var<br> &nbsp;i,j,k,o:byte;<br> &nbsp;s:string;<br> &nbsp;s3:str3;<br><br>begin<br><br> &nbsp;s:=paramstr(1);<br><br> &nbsp;if length(s)&gt;12 then begin<br> &nbsp; &nbsp;writeln('число слишком велико');<br> &nbsp; &nbsp;halt<br> &nbsp;end;<br><br> &nbsp;for i:=1 to length(s) do if s[i] in [#0..pred('0'),succ('9')..#255] then begin<br> &nbsp; &nbsp;writeln('недопустимый нечисловой символ');<br> &nbsp; &nbsp;halt;<br> &nbsp;end;<br><br> &nbsp;while (s[1]='0')and(length(s)&gt;1) do s:=copy(s,2,length(s)-1);<br><br> &nbsp;if s='0' then write('ноль') else begin<br><br><br> &nbsp;k:=length(s) div 3;<br> &nbsp;o:=length(s)-3*k;<br> &nbsp;if o=0 then o:=3 else inc(k);<br><br> &nbsp;i:=0;<br> &nbsp;j:=1;<br> &nbsp;s3:='';<br> &nbsp;while j&lt;=length(s) do begin<br> &nbsp; &nbsp;s3:=s3+s[j];<br> &nbsp; &nbsp;inc(i);<br> &nbsp; &nbsp;inc(j);<br> &nbsp; &nbsp;if i=o then begin<br> &nbsp; &nbsp; &nbsp;i:=0;<br> &nbsp; &nbsp; &nbsp;tetr(k,o,s3);<br> &nbsp; &nbsp; &nbsp;s3:='';<br> &nbsp; &nbsp; &nbsp;dec(k);<br> &nbsp; &nbsp; &nbsp;o:=3<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br><br> &nbsp;end;<br> &nbsp;writeln;<br>end.<br><br>---cut here :D]]></description>
        <author>zheromo</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95582</guid>
        <pubDate>Wed, 26 Jun 2002 04:23:09 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95582</link>
        <description><![CDATA[GrAnd: Кстати с английскихм языком проблем особых не возникает. К счастью все намного проще. ;D ;D ;D]]></description>
        <author>GrAnd</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95581</guid>
        <pubDate>Tue, 25 Jun 2002 20:17:15 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95581</link>
        <description><![CDATA[rhf: желающим могу прислать несколько вариантов на паскале........и не только для русского языка :)<br>]]></description>
        <author>rhf</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95580</guid>
        <pubDate>Tue, 25 Jun 2002 05:17:09 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95580</link>
        <description><![CDATA[GrAnd: Да, для больших чисел придеться еще учесть и падежи. ;)]]></description>
        <author>GrAnd</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95579</guid>
        <pubDate>Mon, 24 Jun 2002 16:19:18 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95579</link>
        <description><![CDATA[Jin X: И не забудьте про числа &gt; 1000, т.е. чтоб было не<br>&quot;два тысяча триста двадцать пять&quot; ;D]]></description>
        <author>Jin X</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95578</guid>
        <pubDate>Mon, 24 Jun 2002 06:45:43 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95578</link>
        <description><![CDATA[GrAnd: Не забудьте про числа от11 до 19 &nbsp;;D ;D ;D]]></description>
        <author>GrAnd</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95577</guid>
        <pubDate>Sun, 23 Jun 2002 14:22:05 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95577</link>
        <description><![CDATA[DEiL: :)]]></description>
        <author>DEiL</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95576</guid>
        <pubDate>Sun, 23 Jun 2002 14:11:51 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95576</link>
        <description><![CDATA[Chainick: ага, а если есть _примерно_ так (пишу по памяти);<br><br>switch(i)<br>{<br> case 1 : a[i] = &quot;адын&quot;;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br> //... etc <br>}<br><br>if (i ==19) a[i] = &quot;Девятнадцать&quot;;<br><br>//....<br><br>if (i == 156) a[i] = a[100]+a[50]+a[6];<br><br>Хотя, наверное твой примерчик поинтереснее будет... <br>thanks &amp; beer for Matrix Club &nbsp;;)]]></description>
        <author>Chainick</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95575</guid>
        <pubDate>Sun, 23 Jun 2002 13:13:35 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95575</link>
        <description><![CDATA[DEiL: гыг \%)<br>ed[0] = &quot;&quot;<br>ed[1] = &quot;один&quot;<br>ed[2] = &quot;два&quot;<br>..<br>ed[9] = &quot;девять&quot;<br><br>des[0] = &quot;&quot;<br>des[1] = &quot;десять&quot;<br>des[2] = &quot;двадцать&quot;<br>..<br>des[9] = &quot;девяносто&quot;<br><br>sot[0] = &quot;&quot;<br>sot[1] = &quot;сто&quot;<br>sot[2] = &quot;двести&quot;<br>..<br>sot[9] = &quot;девятьсот&quot;<br><br>и т.д.<br><br>далее:<br>str = sot[кол_во_сот] + des[кол_во_десятков<strong class='tag-b'>]</strong> + des[кол_во_единиц]<br><strong class='tag-b'> ;DGrAnd: Забыл скобочку ;D</strong><br>для числа 156 получаем : стопятьдесятшесть -))<br><br>только вот надо немного по-другому обработать одиннадцать-девятнадцать :)<br><br>ну как? =)]]></description>
        <author>DEiL</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95574</guid>
        <pubDate>Sun, 23 Jun 2002 12:48:47 +0000</pubDate>
        <title>Представить чисто в сроковом виде</title>
        <link>https://forum.sources.ru/index.php?showtopic=9999&amp;view=findpost&amp;p=95574</link>
        <description><![CDATA[Chainick: Есть скажем число. Нужно его представить в строковом виде, т-е<br><br>1 -&gt; адын<br>2 -&gt; два<br>156 -&gt; ...<br><br>Как бы это оформить покрасивее, потому что я в принципе сделал, но с помощью switch, if-else. Геморно]]></description>
        <author>Chainick</author>
        <category>Алгоритмы</category>
      </item>
	
      </channel>
      </rss>
	