c#三角形

             int n = 10;
            for (int i = 1; i <= n; i++)
            {
                Console.Write(new string(' ', n - i));
                for (int j = 1; j <= i - 1; j++)
                    Console.Write(" *");
                Console.Write("\n");
            }
            Console.ReadKey();

 

posted @ 2015-08-31 11:21  尘梦  阅读(756)  评论(0编辑  收藏  举报