输入一个N整数,结果为1 23 456 78910

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a,b,i,n;
    a=1;
    i=1;
    scanf("%d",&n);
    while(a<=n) //行数n
    {
        b=1;


        while(b<=a)//每列多少个字符
        {


            printf(" %d",i);
            i++;
            b++;


        }
        a++;
        printf("\n");
    }
    system("pause");
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_42252769/article/details/80550828
456
今日推荐