#include <iostream>
using namespace std;
void xin()
{
int i,j,k;
for (i=1;i<=10;i++)
{
for (j=1; j<=10-i;j++)
cout<<"1";
for ( k=1; k<=2*i-1;k++)
cout<<"*";
for (j=1; j<=10-i;j++)
cout<<"1";
cout<<endl;
}
for(i=9;i>=1;i--)
{
for (j=1;j<=10-i;j++)
cout<<"1";
for(k=1;k<=2*i-1;k++)
cout<<"*";
for (j=1; j<=10-i;j++)
cout<<"1";
cout<<endl;
}
using namespace std;
void xin()
{
int i,j,k;
for (i=1;i<=10;i++)
{
for (j=1; j<=10-i;j++)
cout<<"1";
for ( k=1; k<=2*i-1;k++)
cout<<"*";
for (j=1; j<=10-i;j++)
cout<<"1";
cout<<endl;
}
for(i=9;i>=1;i--)
{
for (j=1;j<=10-i;j++)
cout<<"1";
for(k=1;k<=2*i-1;k++)
cout<<"*";
for (j=1; j<=10-i;j++)
cout<<"1";
cout<<endl;
}
}
嵌套循环,count<<"1"中i是几就会输出几个,