mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-05 06:37:35 +08:00
14 lines
1.4 KiB
HTML
14 lines
1.4 KiB
HTML
组合数的和
|
||
<div class="ques-view"><p>给定 N 个非 0 的个位数字,用其中任意 2 个数字都可以组合成 1 个 2 位的数字。要求所有可能组合出来的 2 位数字的和。例如给定 2、5、8,则可以组合出:25、28、52、58、82、85,它们的和为330。</p>
|
||
<h3 id="-">输入格式:</h3>
|
||
<p>输入在第一行中给出 N(1 <span class="katex"><span class="katex-mathml"><math><mrow><mo><</mo></mrow><</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.5391em;"></span><span class="strut bottom" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="base textstyle uncramped"><span class="mrel"><</span></span></span></span> N <span class="katex"><span class="katex-mathml"><math><mrow><mo><</mo></mrow><</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.5391em;"></span><span class="strut bottom" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="base textstyle uncramped"><span class="mrel"><</span></span></span></span> 10),随后一行给出 N 个不同的非 0 个位数字。数字间以空格分隔。</p>
|
||
<h3 id="-">输出格式:</h3>
|
||
<p>输出所有可能组合出来的2位数字的和。</p>
|
||
<h3 id="-">输入样例:</h3>
|
||
<pre><code class="lang-in">3
|
||
2 8 5
|
||
</code></pre>
|
||
<h3 id="-">输出样例:</h3>
|
||
<pre><code class="lang-out">330
|
||
</code></pre>
|
||
</div> |