You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
593 B
42 lines
593 B
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main()
|
|
{
|
|
int line = 0;
|
|
printf("");
|
|
scanf("%d", &line);
|
|
int i = 0;
|
|
for (i = 0; i < line; i++)
|
|
{
|
|
int j = 0;
|
|
for (j = 0; j < line - 1 - i; j++)
|
|
{
|
|
printf(" ");
|
|
}
|
|
for (j = 0; j < 2 * i + 1; j++)
|
|
{
|
|
printf("*");
|
|
}
|
|
printf("\n");
|
|
}
|
|
for (i = 0; i < line - 1; i++)
|
|
{
|
|
int j = 0;
|
|
for (j = 0; j <= i; j++)
|
|
{
|
|
printf(" ");
|
|
}
|
|
for (j = 0; j < 2 * (line - 1 - i) - 1; j++)
|
|
{
|
|
printf("*");
|
|
}
|
|
printf("\n");
|
|
}
|
|
system("pause");
|
|
return 0;
|
|
}
|