打印如图下非标
代码如下
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)
#include<stdio.h>
#include<string.h>
int main()
{int n = 0;while (scanf("%d", &n) == 1){//上n行int i = 0;for (i = 0; i < n; i++){int j = 0;for (j = 0; j<n-i; j++)//空格{printf(" ");}for (j = 0; j <=i; j++)//星号{printf("*");}printf("\n");}/*下n行*/for (i = 0; i < n + 1; i++){int j = 0;for (j = 0; j <i ; j++)//空格{printf(" ");}for (j = 0; j <n-i+1 ; j++){printf("*");//星号}printf("\n");}}return 0;
}