110,537
社区成员
发帖
与我相关
我的任务
分享
Number.cs
class Number
{
private int from; //开始数
private int to; //结束数
private static int temp = 1;
private string str;
public static ArrayList list = new ArrayList(100);
public Number(int i, int j)
{
from = i;
to = j;
}
public void print(int k)
{
str =string .Format ("{0}+{1}={2}\n",temp ,k+1,temp +k+1);
temp += k + 1;
list.Add(str);
}
public void Add()
{
while (from <= to - 1)
{
print(from);
from++;
}
}
from.sc private void btnOK_Click(object sender, EventArgs e)
{
Number num = new Number(int.Parse(txtNumber1.Text), int.Parse(txtNumber2.Text));
num.Add();
}
private void timer1_Tick(object sender, EventArgs e)
{
if ( i< Number.list.Count)
{
lstBox.Items.Add(Number.list[i]);
i++;
}
}
public void print(int k)
{
str =string .Format ("{0}+{1}={2}\n",temp ,k+1,temp +k+1);
temp += k + 1;
lstBox.Items.Add(str);
Application.DoEvents();
}