Files
PAT/source/html/b1036.html
T

17 lines
2.0 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.
跟奥巴马一起编程
<div class="ques-view"><p>美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统。2014 年底,为庆祝“计算机科学教育周”正式启动,奥巴马编写了很简单的计算机代码:在屏幕上画一个正方形。现在你也跟他一起画吧!</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.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><mn>3</mn><mo>≤</mo><mi>N</mi><mo>≤</mo><mn>2</mn><mn>0</mn></mrow>3\le N\le 20</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.8193em;vertical-align:-0.13597em;"></span><span class="base textstyle uncramped"><span class="mord mathrm">3</span><span class="mrel">≤</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mrel">≤</span><span class="mord mathrm">2</span><span class="mord mathrm">0</span></span></span></span>)和组成正方形边的某种字符 C,间隔一个空格。</p>
<h3 id="-">输出格式:</h3>
<p>输出由给定字符 C 画出的正方形。但是注意到行间距比列间距大,所以为了让结果看上去更像正方形,我们输出的行数实际上是列数的 50%(四舍五入取整)。</p>
<h3 id="-">输入样例:</h3>
<pre><code class="lang-in">10 a
</code></pre>
<h3 id="-">输出样例:</h3>
<pre><code class="lang-out">aaaaaaaaaa
a a
a a
a a
aaaaaaaaaa
</code></pre>
</div>