啊哈磊_编程从这里起步

标题: 176页第2题怎么编??? [打印本页]

作者: jyx1990    时间: 2013-4-1 18:29
标题: 176页第2题怎么编???

求助.jpg (12.29 KB, 下载次数: 71)

怎么做啊?

怎么做啊?

作者: rosynirvana    时间: 2013-4-2 13:41
http://bbs.ahalei.com/thread-1340-1-1.html
作者: osblow    时间: 2013-4-20 02:32
#include <stdio.h>
int main()
{
        int i=1,j=1;
    int n=5;
    while(i<=(n+2)*(n-1)/2+1)
    {
                printf("%d\t",i);
        if(i==(j+2)*(j-1)/2+1)
        {
                        putchar('\n');
            j++;
        }
        i++;
    }
        getch();
        return 0;
}




欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2