Files
PAT/source/html/a1082.html
T

19 lines
1.3 KiB
HTML

Read Number in Chinese
<div class="ques-view"><p>Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output <code>Fu</code> first if it is negative. For example, -123456789 is read as <code>Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu</code>. Note: zero (<code>ling</code>) must be handled correctly according to the Chinese tradition. For example, 100800 is <code>yi Shi Wan ling ba Bai</code>.</p>
<h3 id="input-specification-">Input Specification:</h3>
<p>Each input file contains one test case, which gives an integer with no more than 9 digits.</p>
<h3 id="output-specification-">Output Specification:</h3>
<p>For each test case, print in a line the Chinese way of reading the number. The characters are separated by a space and there must be no extra space at the end of the line.</p>
<h3 id="sample-input-1-">Sample Input 1:</h3>
<pre><code class="lang-in">-123456789
</code></pre>
<h3 id="sample-output-1-">Sample Output 1:</h3>
<pre><code class="lang-out">Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu
</code></pre>
<h3 id="sample-input-2-">Sample Input 2:</h3>
<pre><code class="lang-in">100800
</code></pre>
<h3 id="sample-output-2-">Sample Output 2:</h3>
<pre><code class="lang-out">yi Shi Wan ling ba Bai
</code></pre>
</div>