A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© Adam_Eve 中级黑马   /  2015-1-24 16:08  /  869 人查看  /  3 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

#include <stdio.h>
#include <stdlib.h>       
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int i,j,m;
for(i=1;i<=9;i++)
{
  for(j=1;j<=i;j++)
   {
              m=i*j;
      printf("%d*%d=%d\t",i,j,m);
   }
   printf("\n");
}

}

3 个回复

倒序浏览
这个是基础测试题吧,不错
回复 使用道具 举报
帮你简化一下

#include <stdio.h>

int main()
{
        for(int row = 1; row<=9; row++) // row:..成排
   {
                for(int column  = 1; column<=row; column++)
                {   //  column:纵对、列

                   printf("%d * %d = %d  ", row, column, row * column);
                }

                printf("\n");
        }   
}
回复 使用道具 举报
MacxChina 发表于 2015-1-27 01:16
帮你简化一下

#include

嗯嗯。。。。。。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马