本文共 906 字,大约阅读时间需要 3 分钟。
**
**
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 HomeTest005{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int a = Convert.ToInt32(txtIn.Text); for (int i = 1;i <= a;i++) { for (int n= 1; n <= a - i; n++) { lblOut.Text+=Convert.ToString(" "); } for (int j= 1; j <= 2*i-1; j++) { lblOut.Text+=Convert.ToString("*"); } lblOut.Text+=Convert.ToString("\n"); } } } }
转载地址:http://mwywi.baihongyu.com/