Files
PAT/source/html/b1006.html
T
2018-12-23 20:01:49 +08:00

26 lines
2.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
.katex-html {display: none;}
.katex-mathml {font-size: 0px;}
.katex-mathml math mrow {font-size: 16px;}
</style>
<h1>换个格式输出整数</h1>
<div class="ques-view"><p>让我们用字母 <code>B</code> 来表示“百”、字母 <code>S</code> 表示“十”,用 <code>12...n</code> 来表示不为零的个位数字 <code>n</code>(<span class="katex"><span class="katex-mathml"><math><mrow><mo>&lt;</mo><mn>1</mn><mn>0</mn></mrow>&lt;10</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">&lt;</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span></span></span></span>),换个格式来输出任一个不超过 3 位的正整数。例如 <code>234</code> 应该被输出为 <code>BBSSS1234</code>,因为它有 2 个“百”、3 个“十”、以及个位的 4。</p>
<h3 id="-">输入格式:</h3>
<p>每个测试输入包含 1 个测试用例,给出正整数 <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.43056em;"></span><span class="strut bottom" style="height:0.43056em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit">n</span></span></span></span>(<span class="katex"><span class="katex-mathml"><math><mrow><mo>&lt;</mo><mn>1</mn><mn>0</mn><mn>0</mn><mn>0</mn></mrow>&lt;1000</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">&lt;</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mord mathrm">0</span><span class="mord mathrm">0</span></span></span></span>)。</p>
<h3 id="-">输出格式:</h3>
<p>每个测试用例的输出占一行,用规定的格式输出 <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.43056em;"></span><span class="strut bottom" style="height:0.43056em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit">n</span></span></span></span>。</p>
<h3 id="-1-">输入样例 1:</h3>
<pre><code class="lang-in">234
</code></pre>
<h3 id="-1-">输出样例 1:</h3>
<pre><code class="lang-out">BBSSS1234
</code></pre>
<h3 id="-2-">输入样例 2:</h3>
<pre><code class="lang-in">23
</code></pre>
<h3 id="-2-">输出样例 2:</h3>
<pre><code class="lang-out">SS123
</code></pre>
</div>