#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int n = 0;
scanf("%d", &n);
int sum_z = 3 * n;//树枝总行数
int sum = 3 * n - 1;//开始的空格最大值
for (int i = 1; i <= sum_z; i++)//树枝的行数
{
//开始的空格
for (int r = 0; r <= sum - i; r++)
printf(" ");
int k = (i - 1) / 3 + 1;//图形输出次数
while (k--) {
switch (i % 3) {
case 1: printf("* "); break;
case 2: printf("* * "); break;
case 0: printf("* * * "); break;
}
}
printf("\n");
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < sum; j++)
printf(" ");
printf("*\n");
}
return 0;
}
#include<stdio.h>
int main()
{
int n = 0;
scanf("%d", &n);
int sum_z = 3 * n;//树枝总行数
int sum = 3 * n - 1;//开始的空格最大值
for (int i = 1; i <= sum_z; i++)//树枝的行数
{
//开始的空格
for (int r = 0; r <= sum - i; r++)
printf(" ");
int k = (i - 1) / 3 + 1;//图形输出次数
while (k--) {
switch (i % 3) {
case 1: printf("* "); break;
case 2: printf("* * "); break;
case 0: printf("* * * "); break;
}
}
printf("\n");
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < sum; j++)
printf(" ");
printf("*\n");
}
return 0;
}