c++星号列阵 使左下角右下角的三角形区域都输出星号

img

意思肯定是6列吗?只有行是不确定的?

#include <stdio.h>
int main(int argc, char const *argv[])
{
    int a;
    scanf("%d", &a);
    for (int i = 0; i < a; i++)
    {
        for (int j = 0; j < a; j++)
        {
            if (j > i && j < (a - i - 1))
                printf(" ");
            else
                printf("*");
        }
        printf("\n");
    }
}

img