12.20练习一

Console.WriteLine("请输入直角三角形的行数:");

int a = Convert.ToInt32(Console .ReadLine ());

for (int i = 1; i <= a; i++)

{

for (int j = 0; j < 2 * i - 1; j++)

{

Console.Write("*");

}

Console.WriteLine();

}

Console.ReadKey();

}

你可能感兴趣的:(12.20练习一)