mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-04 00:38:13 +08:00
26 lines
2.6 KiB
HTML
26 lines
2.6 KiB
HTML
Mars Numbers
|
|
<div class="ques-view"><p>People on Mars count their numbers with base 13:</p>
|
|
<ul>
|
|
<li>Zero on Earth is called "tret" on Mars.</li>
|
|
<li>The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively.</li>
|
|
<li>For the next higher digit, Mars people name the 12 numbers as "tam, hel, maa, huh, tou, kes, hei, elo, syy, lok, mer, jou", respectively.</li>
|
|
</ul>
|
|
<p>For examples, the number 29 on Earth is called "hel mar" on Mars; and "elo nov" on Mars corresponds to 115 on Earth. In order to help communication between people from these two planets, you are supposed to write a program for mutual translation between Earth and Mars number systems.</p>
|
|
<h3 id="input-specification-">Input Specification:</h3>
|
|
<p>Each input file contains one test case. For each case, the first line contains a positive integer <span class="katex"><span class="katex-mathml"><math><mrow><mi>N</mi></mrow>N</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.68333em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.10903em;">N</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math><mrow><mo><</mo><mn>1</mn><mn>0</mn><mn>0</mn></mrow>< 100</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.64444em;"></span><span class="strut bottom" style="height:0.68354em;vertical-align:-0.0391em;"></span><span class="base textstyle uncramped"><span class="mrel"><</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mord mathrm">0</span></span></span></span>). Then <span class="katex"><span class="katex-mathml"><math><mrow><mi>N</mi></mrow>N</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.68333em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.10903em;">N</span></span></span></span> lines follow, each contains a number in [0, 169), given either in the form of an Earth number, or that of Mars.</p>
|
|
<h3 id="output-specification-">Output Specification:</h3>
|
|
<p>For each number, print in a line the corresponding number in the other language.</p>
|
|
<h3 id="sample-input-">Sample Input:</h3>
|
|
<pre><code class="lang-in">4
|
|
29
|
|
5
|
|
elo nov
|
|
tam
|
|
</code></pre>
|
|
<h3 id="sample-output-">Sample Output:</h3>
|
|
<pre><code class="lang-out">hel mar
|
|
may
|
|
115
|
|
13
|
|
</code></pre>
|
|
</div> |