方法1:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 10; i++)
{
for (int t = 1; t <= i;t++ )
{
Console.Write("★");
}
Console.Write("
");
}
Console.ReadLine();
}
}
}
方法2:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string a = ""; string b = "★"; for (int i = 1; i <= 10; i++) { a = a + b; Console.Write(a); Console.Write(" "); } Console.ReadLine(); } } }