在C# 在 textBox1.text 中输入 3,在textBox2.text 中输入 3,怎么才能在textBox3.text 中显示它们相乘的

果 9.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace stackTest
{
class StackTest
{
private int[] Stack;
private int Top= -1;//栈的当前位置
public StackTest(int num)
{
Stack= New int[num];//初始化栈大小
}
public int Length
{
get
{
return Top;
}
}
public void Push(int num)//入栈
{
if(Top<Stack.Length)
Stack[++Top]=num;
else
MessageBox.Show("Stack is Full");
}

public void Pop()//出栈
{
if(Top>-1)
Top--;
else
MessageBox.Show("Stack is Empty");
}
public void ShowStack()//显示当前栈内值
{
for(int i=0;i<=Top;i++)
Console.WriteLine(Stack[i].ToString());
}
}
class Program
{
static void Main(string[] args)
{
StackTest stack = new StackTest(100);//初始化栈
stack.Push(100);//入栈值
stack.Push(200);
stack.Push(300);
stack.Push(400);
ShowStack();//显示栈内值
}
}
}

方法给你了,你修改下就可以用了!
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-01-30
是动态显示吗?还是需要一个按钮触发?把9赋值给textBox3.text就可以吧
第2个回答  2011-01-30
用mousedown事件
相似回答