2019-03-31 11:00:21 +00:00
|
|
|
|
---
|
|
|
|
|
title: というわけでやってみた
|
|
|
|
|
author: kazu634
|
|
|
|
|
date: 2008-04-27
|
|
|
|
|
wordtwit_post_info:
|
|
|
|
|
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:3947;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
|
|
|
|
|
categories:
|
|
|
|
|
- C
|
|
|
|
|
- Programming
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
<div class="section">
|
|
|
|
|
<blockquote title="武蔵の日記" cite="http://d.hatena.ne.jp/sirocco634/">
|
|
|
|
|
<p>
|
|
|
|
|
「ネストが2のfor」の練習で、掛け算九九の表を出力するプログラムは、結構いい例題になりませんか?
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
<cite><a href="http://d.hatena.ne.jp/sirocco634/" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/sirocco634/', '武蔵の日記');" target="_blank">武蔵の日記</a></cite>
|
|
|
|
|
</p>
|
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
こんな感じかしら?
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<pre class="syntax-highlight">
|
|
|
|
|
<span class="synPreProc">#include </span><span class="synConstant"><stdio.h></span>
|
|
|
|
|
<span class="synType">int</span> main(<span class="synType">void</span>);
|
|
|
|
|
<span class="synType">int</span> main(<span class="synType">void</span>)
|
|
|
|
|
{
|
|
|
|
|
<span class="synType">int</span> i, j;
|
|
|
|
|
printf (<span class="synConstant">"九九表</span><span class="synSpecial">\n</span><span class="synConstant">"</span>);
|
|
|
|
|
<span class="synStatement">for</span> (i = <span class="synConstant">1</span>;i < <span class="synConstant">10</span>;i++) {
|
|
|
|
|
printf (<span class="synConstant">"</span><span class="synSpecial">%d</span><span class="synConstant"> の段:</span><span class="synSpecial">\n</span><span class="synConstant">"</span>, i);
|
|
|
|
|
<span class="synStatement">for</span> (j = <span class="synConstant">1</span>;j < <span class="synConstant">10</span>;j++) {
|
|
|
|
|
printf (<span class="synConstant">"</span><span class="synSpecial">%d</span><span class="synConstant"> * </span><span class="synSpecial">%d</span><span class="synConstant"> = </span><span class="synSpecial">%d</span><span class="synConstant"> "</span>, i, j, i * j);
|
|
|
|
|
}
|
|
|
|
|
printf (<span class="synConstant">"</span><span class="synSpecial">\n</span><span class="synConstant">"</span>);
|
|
|
|
|
}
|
|
|
|
|
<span class="synStatement">return</span> (<span class="synConstant"></span>);
|
|
|
|
|
}
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
表示方法をもっと頑張ってみるべきかな?
|
|
|
|
|
</p>
|
2019-04-02 16:06:15 +00:00
|
|
|
|
</div>
|