回 帖 发 新 帖 刷新版面

主题:打印九九乘法表(瞎回也给分)


  打印九九乘法表

回复列表 (共7个回复)

沙发

用QB:for a=1 to 9
 for b=1 to 9
  c=a*b
  print a;"*";b;"=";c;
 next b
 print
next a
end

板凳


for(int j=1;j<=9;j++)
{
      for(int i=1;i<=j;i++)
             cout<<i<<"*"<<j<<"="<<i*j<<"  ";
      cout<<endl;
}

3 楼

for a=1 to 9
 for b=1 to 9
  c=a*b
  print a;"*";b;"=";c;
 next b
 print
next a
end
  

4 楼

for a=1 to 9
 for b=1 to 9
  c=a*b
  print a;"*";b;"=";c;
 next b
 print
next a
end
  

5 楼

#include "stdio.h"
main()
{
 int i,j,result;
 printf("\n");
 for (i=1;i<10;i++)
  { for(j=1;j<10;j++)
    {
     result=i*j;
     printf("%d*%d=%-3d",i,j,result);/*-3d表示左对齐,占3位*/
    }
   printf("\n");/*每一行后换行*/
  }
}

6 楼

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="zh-CN" />

7 楼

好高深哦。。。

我来回复

您尚未登录,请登录后再回复。点此登录或注册