搜索
查看: 2015|回复: 8
打印 上一主题 下一主题

【第四章第10节第1,2题】我用while做的

[复制链接]
楼主
发表于 2014-12-16 16:34:40 | 显示全部楼层
#include <stdio.h>
#include <stdlib.h>
int main()
{
        int a,b,c;
    for(a=1;a<=9;a++)
    {
                for(b=1;b<=9;b++)
        {
                        c=b*a;
                        printf("%d*%d=%d \n",a,b,c);
        }
    }
   
   
        system("pause");
        return 0;
}
沙发
发表于 2014-12-16 16:47:11 | 显示全部楼层
擅自改了一些 cdzjf 製作的.

#include <stdio.h>
#include <stdlib.h>
int main()
{
        int a,b,c,x;
        for(a=1;a<=9;a++)
     {      
                b=1;
                for(x=1;x<=a;x++)
                {
                        c=a*b;
                        printf("%d*%d=%d        ",a,b,c);     
                        b++;  
                }
                printf("\n");
     }
        system("pause");
        return 0;
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表