using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp333
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int empty = 10; //empty是*的个数
for (int i = 1; i <= empty; i++)
{
Enumerable. //整体作用:输出空格三角型
Repeat(" ", empty - i).ToList(). //Repeat(TResult,int count)函数,控制每行的空格数。
ForEach(Console.Write); //ForEach(Action<T> action)函数,对每个元素都执行action函数,即每个元素都
//执行Console.Write函数
Enumerable.Repeat("* ", i).ToList().ForEach(Console.Write); //作用输出*号三角形
Console.WriteLine(); //控制换行
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}