画倒三角形

namespace _7月3日课堂练习
{
    class Program
    {
        static void Main(string[] args)
        {
            
            hua(5);
            Console.ReadKey();

        }


        public static void hua(int n)
        {
            int res = n;
            while (n>=0)
            {
                string str1 = new string(' ', res - n);
                string str2 = new string('*', 2 * n - 1);
                Console.WriteLine("{0}{1}", str1, str2);
                n--;
            }
           
        }

        
 
    }
}
posted @ 2012-07-04 01:54  我的名字很长很长  阅读(155)  评论(0编辑  收藏  举报