static void Main(string[] args)
{
for(int i = 0;i < 4;i++)
{
for(int j = 0;j < 4;j++)
{
Console.Write("*");
}
Console.WriteLine();
}
}这样是打印****
          ****
          ****
          ****现在要打印****
          **
          **
          ****
用continue方法做,想了半天没想出来,望高手指点!!!

解决方案 »

  1.   

    static void Main(string[] args)
    {
    for(int i = 0;i < 4;i++)
    {
    for(int j = 0;j < 4;j++)
    {
    if(i>0&&i<3&&j<2)
    {
      continue;
    }
    Console.Write("*");
    }
    Console.WriteLine();
    }
    }
      

  2.   

    // fangxinggood(JustACoder)正解, 整理如下:using System;
    using System.Data.OleDb;class Test
    {
      static void Main()
      {
        for (int i = 0; i < 4; i++)
        {
          for (int j = 0; j < 4; j++)
          {
            if (i >= 1 && i <= 2 && j > 1) continue;
            Console.Write("*");
          }
          Console.WriteLine();
        }
      }
    }
      

  3.   

    Console.WriteLine(@"****
              **
              **
              ****");