C#window应用程序 编乘法口诀
来源:百度知道 编辑:UC知道 时间:2024/06/30 23:41:14
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int i = int.Parse(this.button1.Text);
for (int t = 1; t < i; t++)
{
for (int n = 1; n <= t;n++ )
{
int y = t * n;
//这边不知道怎么写了???
}
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
this.button1.Text = this.textBox1.Text;
}
}
最后的效果就是:当我在textbox1里输入1~9的任意一个数字,按bu
我想问的是这个程序是要做什么?显示乘法口诀,还是让别人输入一个表达式判断正误?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication32
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int num = 0;
try
{
num = Convert.ToInt32(textBox1.Text);
}
catch
{
MessageBox.Show("请输入一个1-9之间的数字!");
return;
}
if (num <= 0 || num > 9)
{
MessageBox.Show("请输入一个1-9之间的数字!");
return;