九九乘法表

作者在 2011-03-31 10:13:11 发布以下内容
# include<stdio.h>
void main()
{
    int i,j,cj;
    for(i=1;i<=9;i++)
    {
        for(j=1;j<=9;j++)
        {
            cj=i*j;
            if(j<=i)
                printf("%d*%d=%2d    ",j,i,cj);
            else
            {printf("\n");break;}
        }
    }
   system("pause");
}
自己编的程序 | 阅读 855 次
文章评论,共6条
ynwpyv
2011-04-03 14:38
1
system(&quot;pause&quot;);<br />
这个是什么意思啊,我也学习下。。
paoshituan
2011-04-05 19:38
2
可以再优化一下,将第二个for后改为j&lt;=i,可以节省时间,缩短代码,另外,好像输出结果不易观察啊!
paoshituan
2011-04-05 19:39
3
可以再优化一下,将第二个for后改为j&lt;=i,可以节省时间,缩短代码,另外,好像输出结果不易观察啊!
superemewill
2011-04-12 23:50
4
system(&quot;pause&quot;);这条指令可以不要吧
平凡JL
2011-04-23 17:30
5
# include&lt;stdio.h&gt;<br />
void main()<br />
{<br />
&nbsp; &nbsp;&nbsp;&nbsp;int i,j;<br />
&nbsp; &nbsp;&nbsp;&nbsp;for(i=1;i&lt;=9;i++)<br />
&nbsp; &nbsp; {&nbsp;&nbsp;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for(j=1;j&lt;=i;j++)<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printf(&quot;%d*%d=%-5d&quot;,j,i,i*j);<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;printf(&quot;\n&quot;);<br />
&nbsp; &nbsp; }<br />
}<br />
前几天我做作业时也写了一个九九乘发表的源代码,请大虾们多多指教!
Angel乖乖
2011-05-16 16:32
6
<div class="quote"><span class="q"><b>平凡JL</b>: # include&lt;stdio.h&gt;<br />
void main()<br />
{<br />
&nbsp; &nbsp;&nbsp;&nbsp;int i,j;<br />
&nbsp; &nbsp;&nbsp;&nbsp;for(i=1;i&lt;=9;i++)<br />
&nbsp; &nbsp; {&nbsp;&nbsp;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for(j=1;j&lt;=i;j++)<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;printf(&quot;%d*%d</span></div><img src="image/face/3.gif" class="face">挺好的,我也做过,是书上原题
游客请输入验证码
文章归档