标题:输出杨辉三角前10行
取消只看楼主
a1697842
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-9-3
结帖率:100%
 问题点数:0 回复次数:0 
输出杨辉三角前10行
程序代码:
#include<stdio.h>
main()
{
    int a[10][10];
    int i,j;
    for(i=0;i<10;i++)
    for(j=0;j<10;j++)
    if(j==0)
    {
        a[i][j]=1;
        else
        a[i][j]=a[i-1][j-1]+a[i-1][j];
        printf("%5d",a[i][j]);
    }
}
运行提示错误是在else后面,想不出错哪里了
搜索更多相关主题的帖子: 杨辉三角 杨辉三角 
2011-09-05 06:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-349181-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030697 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved