C++编的 你没说清楚是什么语言
#include
void zjs(int h)
{
cout<<"高为"<
for (int j=0;j
cout<<" ";
}
for (int z=0;z<=i;z++)
{
cout<<"*";
}
cout<<"\n";
}
}
void dys(int h)
{
cout<<"高为"<
{
for (int j=1;j<=h-i;j++)
{
cout<<" ";
}
for (int z=1;z<=2*i-1;z++)
{
cout<<"*";
}
cout<<"\n";
}
}
void lxing(int h)
{
cout<<"高为"<
{
for (int j=1;j<=i;j++)
{
cout<<" ";
}
for (int z=1;z<=h;z++)
{
cout<<"*";
}
cout<<"\n";
}
}
void main()
{
int sh;
cout<<"请输入高:"<
zjs(sh);
dys(sh);
lxing(sh);
}
void main()
{
int i, j ,n;
printf("请输入n的值: \n");
scanf_s("%d",&n);
for(i = 1; i <= n; i++)
{
for(j = 1; j <= n-i+1; j++)
{
printf(" ");
}
for(; j <= n+i; j++)
{
printf("*");
}
printf("\n");
}
}