Files
PAT/source/html/a1027.html
T

13 lines
1.2 KiB
HTML

Colors in Mars
<div class="ques-view"><p>People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for <code>Red</code>, the middle 2 digits for <code>Green</code>, and the last 2 digits for <code>Blue</code>. The only difference is that they use radix 13 (0-9 and A-C) instead of 16. Now given a color in three decimal numbers (each between 0 and 168), you are supposed to output their Mars RGB values.</p>
<h3 id="input-specification-">Input Specification:</h3>
<p>Each input file contains one test case which occupies a line containing the three decimal color values.</p>
<h3 id="output-specification-">Output Specification:</h3>
<p>For each test case you should output the Mars RGB value in the following format: first output <code>#</code>, then followed by a 6-digit number where all the English characters must be upper-cased. If a single color is only 1-digit long, you must print a <code>0</code> to its left.</p>
<h3 id="sample-input-">Sample Input:</h3>
<pre><code class="lang-in">15 43 71
</code></pre>
<h3 id="sample-output-">Sample Output:</h3>
<pre><code class="lang-out">#123456
</code></pre>
</div>