int temp = 0;
int n = 5;
for(int i=0;i<n;i++){
for(int j=0;j<n-i;j++){
System.Console.Write(" ");
}

temp = (i+1)*2-1;
for(int j=0;j<temp;j++){
if(j == temp-1){
System.Console.WriteLine("*");
}else{
System.Console.Write("*");
}
}
}

for(int i=0;i<n;i++){
for(int j=0;j<i+2;j++){
System.Console.Write(" ");
}

temp = (n-2-i)*2+1;
for(int j=0;j<temp;j++){
if(j == temp-1){
System.Console.WriteLine("*");
}else{
System.Console.Write("*");
}
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-03-09
  • 2021-06-20
猜你喜欢
  • 2019-12-20
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
相关资源
相似解决方案