using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
Console.Write("请输入直角三角形的行数:");
int number = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= number; i++)
{
for (int a = number; a>=i; a--)
{
Console.Write("*");
}
Console.WriteLine();
}
}
catch
{
Console.WriteLine("您输入的程序错误");
}
Console.ReadKey();
}
}
}
网友评论