string[] xx = new string[5];
xx[0] = "  *  ";
xx[1] = " ***  ";
xx[0] = "*****";
...
for(i = 0-4 )
console.writeline(xx[i]);
谢谢!

解决方案 »

  1.   

    for(int i=1;i<=5;i++)
    {
    for(int j=1;j<=9;j++)
    {
    if(j<=(9-i)/2||j>=(9-i)/2+i)
    {
    printf(" ");
    }
    else
    printf("*");
    }
    }
      

  2.   

    using System;namespace ConsoleApplication1
    {
    /// <summary>
    /// Class1 的摘要说明。
    /// </summary>
    class Class1
    {
    /// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]
    static void Main(string[] args)
    {
    //
    // TODO: 在此处添加代码以启动应用程序
    //
    int a = 5,b=10;
    for(int i=0; i<a; i++) //共五行
    {
    for(int j=0; j<b; j++)
    {
    if( j>= (a-i) && j<= b+i-a )
    {
    Console.Write("*");
    }
    else
    {
    Console.Write(" ");
    }
    }
    Console.WriteLine();
    }
    }
    }
    }