想输出上面那种形式,但是输出的是下面形式,并没有分行(打了分行符号),不知道哪里错了

想输出的是
1
23
456
但输出的是
123456到无穷
结果并没有分行。

这是我写的代码:
#include
#include
int main()
{
int a,b;
a=1;
while(a<=3)
{
b=1;
while(b>=a)
{
printf("%d",b);
b=b+1;
}
printf("\n");
a=a+1;
}

system("pause"); 
return 0;

}


#include<stdio.h>
#include<stdlib.h>
int main()
{
  int a, b, n;
  n = 0;
  a = 1;
  while (a <= 3)
  {
    b = 1;
    while (b <= a)
    {
      n++;
      printf("%d", n);
      b++;
    }
    printf("\n");
    a++;
  }

  system("pause");
  return 0;
}

img

条件错了,如果b大于a的话,因为a是不变的,b++所以b会越来越大