#include
void main()
{
int num = 1;
for(int i=0;i<5;i++)
{
for(int q=0;q<(num+(i*2));i++){
printf("*");
}
printf("\n");
}
}
手打的,没编译过不知道正确不正确
#include
void main()
{
int n,i,j;
printf("请输入行数n:");
while ( !(scanf("%d",&n)) )
{
while (getchar() != '\n')
continue;
printf("请输入行数n:");
}
printf("\n");
for (i = 0 ; i< n ;i++)
{
for (j=0;j
for (j=0;j<=i*2;j++)
printf("*");
printf("\n");
}
}
#include
void main()
{
int i,j;
for(i = 1; i < 12; i = i+2)
for(j = 0; j
{
printf("*");
if(j == i-1)
{
printf("\n");
}
}
}
printf("*\n")
printf("***\n")
printf("*****\n")
printf("*******\n")
printf("***********\n")