当前位置:首页 » 股票资讯 » nequal
扩展阅读
秋枫影院 2025-07-25 21:41:00
正川药业股票行情 2025-07-25 21:19:56
股票估值与股票价格预测 2025-07-25 20:57:45

nequal

发布时间: 2021-07-09 08:31:56

⑴ equals什么意思

打开

equals

常见释义

使等于

equals

n.同样的人( equal的名词复数 ); 相等的数量; 能与之比拟的东西; (地位、实力等)相同的人; 

v.比得上( equal的第三人称单数 ); (质量等方面)赶得上; 与…相等或相同; 使(某物)等于; 

原型:equal

⑵ 简单计算器的源代码

package calculator;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JTextField;
import java.awt.Rectangle;
import javax.swing.JButton;
import javax.swing.BorderFactory;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.SystemColor;
import java.awt.Color;

/**
* <p>Title:</p>
*
* <p>Description: 这个类用来实现一个简单的计算器</p>
*
* <p>Copyright: Copyright (c) 2006年</p>
*
* <p>Company: </p>
*
* @author
* @version 1.0
*/
public class CalculatorFrame extends JFrame {

boolean flag = false;
String operand1;
String operand2;
double result;
String action;

BorderLayout borderLayout1 = new BorderLayout();
JTextField txtresult = new JTextField();
JButton btn1 = new JButton();
JButton btn2 = new JButton();
JButton btn3 = new JButton();
JButton btn4 = new JButton();
JButton btn5 = new JButton();
JButton btn6 = new JButton();
JButton btn7 = new JButton();
JButton btn8 = new JButton();
JButton btn9 = new JButton();
JButton btn0 = new JButton();
JButton btnplus = new JButton();
JButton btnminus = new JButton();
JButton btnjultiply = new JButton();
JButton btndivide = new JButton();
JButton btnclear = new JButton();
JButton btnequal = new JButton();

public CalculatorFrame() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}

private void jbInit() throws Exception {
getContentPane().setLayout(null);
txtresult.setBackground(SystemColor.WHITE);
txtresult.setBorder(BorderFactory.createLoweredBevelBorder());
txtresult.setDisabledTextColor(Color.black);
txtresult.setEditable(false);
txtresult.setHorizontalAlignment(JTextField.RIGHT);
txtresult.setBounds(new Rectangle(50, 50, 305, 25));
btn1.setBounds(new Rectangle(50, 200, 65, 30));
btn1.setBorder(BorderFactory.createRaisedBevelBorder());
btn1.setText("1");
btn1.addActionListener(new CalculatorFrame_btn1_actionAdapter(this));
btn2.setBounds(new Rectangle(130, 200, 65, 30));
btn2.setBorder(BorderFactory.createRaisedBevelBorder());
btn2.setText("2");
btn2.addActionListener(new CalculatorFrame_btn2_actionAdapter(this));
btn3.setBounds(new Rectangle(210, 200, 65, 30));
btn3.setBorder(BorderFactory.createRaisedBevelBorder());
btn3.setText("3");
btn3.addActionListener(new CalculatorFrame_btn3_actionAdapter(this));
btn4.setBounds(new Rectangle(50, 150, 65, 30));
btn4.setBorder(BorderFactory.createRaisedBevelBorder());
btn4.setText("4");
btn4.addActionListener(new CalculatorFrame_btn4_actionAdapter(this));
btn5.setBounds(new Rectangle(130, 150, 65, 30));
btn5.setBorder(BorderFactory.createRaisedBevelBorder());
btn5.setText("5");
btn5.addActionListener(new CalculatorFrame_btn5_actionAdapter(this));
btn6.setBounds(new Rectangle(210, 150, 65, 30));
btn6.setBorder(BorderFactory.createRaisedBevelBorder());
btn6.setText("6");
btn6.addActionListener(new CalculatorFrame_btn6_actionAdapter(this));
btn7.setBounds(new Rectangle(50, 100, 65, 30));
btn7.setBorder(BorderFactory.createRaisedBevelBorder());
btn7.setText("7");
btn7.addActionListener(new CalculatorFrame_btn7_actionAdapter(this));
btn8.setBounds(new Rectangle(130, 100, 65, 30));
btn8.setBorder(BorderFactory.createRaisedBevelBorder());
btn8.setText("8");
btn8.addActionListener(new CalculatorFrame_btn8_actionAdapter(this));
btn9.setBounds(new Rectangle(210, 100, 65, 30));
btn9.setBorder(BorderFactory.createRaisedBevelBorder());
btn9.setText("9");
btn9.addActionListener(new CalculatorFrame_btn9_actionAdapter(this));
btn0.setBounds(new Rectangle(50, 250, 65, 30));
btn0.setBorder(BorderFactory.createRaisedBevelBorder());
btn0.setText("0");
btn0.addActionListener(new CalculatorFrame_btn0_actionAdapter(this));
btnplus.setBounds(new Rectangle(290, 250, 65, 30));
btnplus.setBorder(BorderFactory.createRaisedBevelBorder());
btnplus.setText("+");
btnplus.addActionListener(new CalculatorFrame_btnplus_actionAdapter(this));
btnminus.setBounds(new Rectangle(290, 200, 65, 30));
btnminus.setBorder(BorderFactory.createRaisedBevelBorder());
btnminus.setText("-");
btnminus.addActionListener(new CalculatorFrame_btnminus_actionAdapter(this));
btnjultiply.setBounds(new Rectangle(290, 150, 65, 30));
btnjultiply.setBorder(BorderFactory.createRaisedBevelBorder());
btnjultiply.setText("*");
btnjultiply.addActionListener(new
CalculatorFrame_btnjultiply_actionAdapter(this));
btndivide.setBounds(new Rectangle(290, 100, 65, 30));
btndivide.setBorder(BorderFactory.createRaisedBevelBorder());
btndivide.setText("/");
btndivide.addActionListener(new CalculatorFrame_btndivide_actionAdapter(this));
btnclear.setBounds(new Rectangle(130, 250, 65, 30));
btnclear.setBorder(BorderFactory.createRaisedBevelBorder());
btnclear.setText("C");
btnclear.addActionListener(new CalculatorFrame_btnclear_actionAdapter(this));
btnequal.setBounds(new Rectangle(210, 250, 65, 30));
btnequal.setBorder(BorderFactory.createRaisedBevelBorder());
btnequal.setText("=");
btnequal.addActionListener(new CalculatorFrame_btnequal_actionAdapter(this));
this.getContentPane().setBackground(UIManager.getColor(
"MenuItem.background"));
this.setTitle("计算器");
this.getContentPane().add(txtresult);
this.getContentPane().add(btn1);
this.getContentPane().add(btn0);
this.getContentPane().add(btnclear);
this.getContentPane().add(btnplus);
this.getContentPane().add(btnequal);
this.getContentPane().add(btn2);
this.getContentPane().add(btn3);
this.getContentPane().add(btnminus);
this.getContentPane().add(btn4);
this.getContentPane().add(btn7);
this.getContentPane().add(btn5);
this.getContentPane().add(btn6);
this.getContentPane().add(btnjultiply);
this.getContentPane().add(btndivide);
this.getContentPane().add(btn9);
this.getContentPane().add(btn8);
}

public void btnplus_actionPerformed(ActionEvent e) {
action = "plus";
operand1 = txtresult.getText();
txtresult.setText("");
flag = true;
}

public void btnminus_actionPerformed(ActionEvent e) {
action = "minus";
operand1 = txtresult.getText();
txtresult.setText("");
flag = true;
}

public void btnjultiply_actionPerformed(ActionEvent e) {
action = "multiply";
operand1 = txtresult.getText();
txtresult.setText("");
flag = true;
}

public void btndivide_actionPerformed(ActionEvent e) {
action = "divide";
operand1 = txtresult.getText();
txtresult.setText("");
flag = true;
}

public void btnclear_actionPerformed(ActionEvent e) {
txtresult.setText("");
}

public void btn1_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn1.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn1.getActionCommand());
}

}

public void btn2_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn2.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn2.getActionCommand());
}

}

public void btn3_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn3.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn3.getActionCommand());
}

}

public void btn4_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn4.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn4.getActionCommand());
}

}

public void btn5_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn5.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn5.getActionCommand());
}

}

public void btn6_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn6.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn6.getActionCommand());
}

}

public void btn7_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn7.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn7.getActionCommand());
}

}

public void btn8_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn8.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn8.getActionCommand());
}

}

public void btn9_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn9.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn9.getActionCommand());
}

}

public void btn0_actionPerformed(ActionEvent e) {
if (flag) {
txtresult.setText(btn0.getActionCommand());
flag=false;
} else {
txtresult.setText(txtresult.getText() + btn0.getActionCommand());
}

}

public void btnequal_actionPerformed(ActionEvent e) {
double digit1, digit2;
operand2 = txtresult.getText();
if (flag == false) {
if (action.equals("plus")) {
digit1 = Double.parseDouble(operand1);
digit2 = Double.parseDouble(operand2);
result = digit1 + digit2;
txtresult.setText(String.valueOf((int) result));
flag = true;
} else if (action.equals("minus")) {
digit1 = Double.parseDouble(operand1);
digit2 = Double.parseDouble(operand2);
result = digit1 - digit2;
txtresult.setText(String.valueOf((int) result));
flag = true;
} else if (action.equals("multiply")) {
digit1 = Double.parseDouble(operand1);
digit2 = Double.parseDouble(operand2);
result = digit1 * digit2;
txtresult.setText(String.valueOf((int) result));
flag = true;
} else if (action.equals("divide")) {
digit1 = Double.parseDouble(operand1);
digit2 = Double.parseDouble(operand2);
result = digit1 / digit2;
if (digit2==0) {
txtresult.setText("ERROR");
flag=true;
} else {
txtresult.setText(String.valueOf((int) result));
flag = true;
}
}

}

}

class CalculatorFrame_btnequal_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btnequal_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnequal_actionPerformed(e);
}
}

class CalculatorFrame_btn0_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn0_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn0_actionPerformed(e);
}
}

class CalculatorFrame_btn9_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn9_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn9_actionPerformed(e);
}
}

class CalculatorFrame_btn8_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn8_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn8_actionPerformed(e);
}
}

class CalculatorFrame_btn7_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn7_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn7_actionPerformed(e);
}
}

class CalculatorFrame_btn6_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn6_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn6_actionPerformed(e);
}
}

class CalculatorFrame_btn5_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn5_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn5_actionPerformed(e);
}
}

class CalculatorFrame_btn4_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn4_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn4_actionPerformed(e);
}
}

class CalculatorFrame_btn2_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn2_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn2_actionPerformed(e);
}
}

class CalculatorFrame_btn3_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn3_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn3_actionPerformed(e);
}
}

class CalculatorFrame_btnclear_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btnclear_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnclear_actionPerformed(e);
}
}

class CalculatorFrame_btndivide_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btndivide_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btndivide_actionPerformed(e);
}
}

class CalculatorFrame_btnjultiply_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btnjultiply_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnjultiply_actionPerformed(e);
}
}

class CalculatorFrame_btnminus_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btnminus_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnminus_actionPerformed(e);
}
}

class CalculatorFrame_btnplus_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btnplus_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnplus_actionPerformed(e);
}
}

class CalculatorFrame_btn1_actionAdapter implements ActionListener {
private CalculatorFrame adaptee;
CalculatorFrame_btn1_actionAdapter(CalculatorFrame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn1_actionPerformed(e);
}
}
}

public class Calculator {

public static void main(String[] args) {

CalculatorFrame Objcal=new CalculatorFrame();

Objcal.setSize(410,320);
Objcal.setVisible(true);
}
}

⑶ vc++ 如果两个字符串的字符和长度都相等,则输出equal,否则输出unequal,要求用字符指针

用以下方法可以解决:
#include"stdio.h"
#include"string.h"
void main()
{
char use1[100],use2[100];
char *p,*q;
p=use1,q=use2;
printf("\n请输入一串字符:");
gets(use1);
printf("\n请输入另一串字符:");
gets(use2);
if(strcmp(p,q)==0)//比较字符串use1和use2;
printf("\n equal \n");
else
printf("\n unequal \n");
}

其实就是用比较字符串的函数strcmp(str1,str2)就可以了,我是初学,也许不对啊!

⑷ java 中actionPerformed的用法

你的那个 btnEqual 不能够被解析,也就是说,你定义的位置,有问题。看不到这个符号,Button btnEqual=new Button("=");
往前提一下,就OK

import java.awt.*;
import java.awt.event.*;
public class Test
{
public static void main(String args[])
{
new TFFrame().launchFrame();
}
}
class TFFrame extends Frame
{
/**
*
*/
Label lbPlus=new Label("+");
Button btnEqual=new Button("=");
private static final long serialVersionUID = 1L;
TextField num1,num2,num3;
public void launchFrame()
{
num1=new TextField(10);
num2=new TextField(10);
num3=new TextField(15);

//btnEqual.addActionListener(new MyMonitor(this));
//btnEqual.addActionListener(new MyMonitor (num1,num2,num3));

btnEqual.addActionListener(new MyMonitor());
setLayout(new FlowLayout());
add(num1);
add(lbPlus);
add(num2);
add(btnEqual);
add(num3);
pack();
setVisible(true);
}

class MyMonitor implements ActionListener
{
public void actionPerformed(ActionEvent e)
{

if(e.getSource()==btnEqual)
{int n1=Integer.parseInt(num1.getText());
int n2=Integer.parseInt(num2.getText());

num3.setText(""+(n1+n2));
}}
}
}

⑸ 用VC++编写内嵌汇编语言,帮忙解释一下一个程序的意思

mov eax,frist
sub eax,second
jnz nequal
你对汇编指令不熟悉,
lea是取地址。之前messge是字符串,所以要使用取地址
jnz就是判断sub指令后的结果,jump if not zero的缩写,如果结果不是0就跳转
=====================================
你们这是什么课啊?还有教反汇编的?还是编译原理??

⑹ C#计算器 (要求:一个textbox接受输入一个计算按钮一个显示结果的textbox)

数据结构课就有讲过表达式求值的算法,你随便找本数据结构的书来看看就知道了,或者在网络搜索“表达式求值”也有很多答案。
我曾经写了一个: 稍微改改就能移植到WinForm下面了。核心代码为一个类:BiaoDaShi,里面的方法都为静态的方法。主要有3个大过程:
1、预处理,把表达式里面的各元素(数字,标识符,算符,括号)识别出来,并存储在一个链表里面,如果有不合法的元素标志出错的位置。
2、把中缀式转换成后缀式。
3、对后缀式求值。
你把这个类写在项目里面,然后在你的button按钮的事件里面引用类的方法不就行了吗?就像我的主函数Main 里那样的使用。或者你改改,思路就是那样的。
namespace BiaoDaShi
{
class Program
{
static void Main(string[] args)
{
List<BiaoDaShi.YuanShu> YCL=new List<BiaoDaShi.YuanShu>();
List<BiaoDaShi.YuanShu> HZS=new List<BiaoDaShi.YuanShu>();
string ss = Console.ReadLine();
while (ss.Length != 0)
{
YCL = BiaoDaShi.YuChuLi(ss);
if (YCL[0].LB == BiaoDaShi.LeiBie.CuoWu)
{
Console.WriteLine("错误:{0}", YCL[0].Zhi);
}
else
{
HZS = BiaoDaShi.ToHouZhuiShi(YCL);
for (int i = 0; i < HZS.Count; i++)
{
Console.Write(HZS[i].Zhi);
Console.Write(' ');
}
Console.Write("----");
Console.Write("结果:");
Console.Write(BiaoDaShi.JiSuan(HZS));
}
Console.WriteLine();
ss = Console.ReadLine();
}
Console.Read();
}
}
class BiaoDaShi
{
/// <summary>
/// 枚举表达式里面各数据的类别(数字,标识符,算符,左括号,右括号,错误)
/// </summary>
public enum LeiBie {ShuZi,BiaoShiFu,SuanFu,ZuoKuoHao,YouKuoHao,CuoWu };
/// <summary>
/// 表达式里面元素的结构(类型,值)
/// </summary>
public struct YuanShu
{
public LeiBie LB;
public string Zhi;
public YuanShu(LeiBie lb, string )
{
this.LB = lb;
this.Zhi = ;
}
};
/// <summary>
/// 比较2个算符的优先级
/// </summary>
/// <param name="ch1"></param>
/// <param name="ch2"></param>
/// <returns></returns>
public static char BiJiao(string ch1, string ch2)
{
int i = YouXianJi(ch1);
int j = YouXianJi(ch2);
if (i<j)
{
return '<';
}
else if (i == j)
{
return '>';
}
else
{
return '>';
}
}
/// <summary>
/// 取得单个字符的优先级
/// </summary>
/// <param name="ch"></param>
/// <returns></returns>
public static int YouXianJi(string ch)
{
switch (ch)
{
case "+": return 1;
case "-": return 1;
case "*": return 2;
case "/": return 2;
case "div": return 2;
case "mod": return 2;
default: return 0;
}
}
/// <summary>
/// 给字符分类(数字,字母,算符,左括号,右括号,错误)
/// </summary>
/// <param name="c"></param>
/// <returns></returns>
public static char ZiFuCeSi(char c)
{
int unicode = Convert.ToInt16(c);
if (unicode >= 48 && unicode <= 58)
{
return 'D';//数字
}
else if (unicode >= 65 && unicode <= 90)
{
return 'L';//字母
}
else if (unicode >= 97 && unicode <= 122)
{
return 'L';//字母
}
else if (unicode == '+' || unicode == '-' || unicode == '*' || unicode == '/' || unicode == '%' || unicode == '$')
{
return 'F';//算符
}
else if (unicode == '(')
{
return '(';
}
else if (unicode == ')')
{
return ')';
}
else
{
return 'E';//错误
}
}
/// <summary>
/// 预处理
/// </summary>
/// <param name="ZhongZhuiShi"></param>
/// <returns></returns>
public static List<YuanShu> YuChuLi(string ZhongZhuiShi)
{
List<YuanShu> LChuLi=new List<YuanShu>();
if (ZhongZhuiShi.Length == 0)
{
YuanShu ys=new YuanShu(LeiBie.CuoWu,"空串");
LChuLi.Add(ys);
return LChuLi;
}
//预处理中缀表达式字符串
if (ZhongZhuiShi.Contains("mod"))
{//把“mod”替换成“%”
ZhongZhuiShi = ZhongZhuiShi.Replace("mod", "%");
}
if (ZhongZhuiShi.Contains("div"))
{//把“div”替换成“$”
ZhongZhuiShi = ZhongZhuiShi.Replace("div", "$");
}

char Ctemp = ' ';
string Stemp = " ";
int ZLength = ZhongZhuiShi.Length;//表达式的长度
Stack<Char> CStack = new Stack<char>();//用于检查括号是否匹配

#region for循环开始

for (int i = 0; i < ZLength; i++)
{
Ctemp = ZhongZhuiShi[i];
Stemp = "";

#region switch-case开始

switch (ZiFuCeSi(Ctemp))
{
case 'D':
{
do
{
Stemp += Ctemp;
if (i == ZLength - 1)
{
break;
}
i++;
Ctemp = ZhongZhuiShi[i];
} while (ZiFuCeSi(Ctemp) == 'D');
YuanShu ys = new YuanShu(LeiBie.ShuZi, Stemp);
LChuLi.Add(ys);
if (ZiFuCeSi(Ctemp) != 'D')
{
if (ZiFuCeSi(Ctemp) == 'L')
{
YuanShu yse = new YuanShu(LeiBie.CuoWu, "错误的数字组合在位置"+i.ToString());
List<YuanShu> Error = new List<YuanShu>();
Error.Add(yse);
return Error;
}
i--;
}
break;
}
case 'L':
{
do
{
Stemp += Ctemp;
if (i == ZLength - 1)
{
break;
}
i++;
Ctemp = ZhongZhuiShi[i];
} while (ZiFuCeSi(Ctemp) == 'L' || ZiFuCeSi(Ctemp) == 'D');
YuanShu ys = new YuanShu(LeiBie.BiaoShiFu, Stemp);
LChuLi.Add(ys);
if (ZiFuCeSi(Ctemp) != 'L')
{
i--;
}
break;
}
case 'F':
{
if (i == 0 || i == ZLength - 1)
{
YuanShu yse = new YuanShu(LeiBie.CuoWu, "错误的算符位置在" + i.ToString());
List<YuanShu> Error = new List<YuanShu>();
Error.Add(yse);
return Error;
}
if (ZiFuCeSi(ZhongZhuiShi[i + 1]) == 'F' || ZiFuCeSi(ZhongZhuiShi[i + 1]) == ')')
{
YuanShu yse = new YuanShu(LeiBie.CuoWu, "错误的算符位置在"+i.ToString());
List<YuanShu> Error = new List<YuanShu>();
Error.Add(yse);
return Error;
}
YuanShu ys = new YuanShu(LeiBie.SuanFu, Ctemp.ToString());
if (Ctemp == '%' )
{
ys.Zhi = "mod";
}
if ( Ctemp == '$')
{
ys.Zhi = "div";
}
LChuLi.Add(ys);
break;
}
case '(':
{
CStack.Push('(');
YuanShu ys = new YuanShu(LeiBie.ZuoKuoHao, "(");
LChuLi.Add(ys);
break;
}
case ')':
{
if (CStack.Count == 0)
{
YuanShu yse = new YuanShu(LeiBie.CuoWu, "括号不匹配");
List<YuanShu> Error = new List<YuanShu>();
Error.Add(yse);
return Error;
}
else
{
CStack.Pop();
}
YuanShu ys = new YuanShu(LeiBie.YouKuoHao, ")");
LChuLi.Add(ys);
break;
}
default:
{
YuanShu ys = new YuanShu(LeiBie.CuoWu, "表达式里有不合法的字符在位置"+i.ToString());
List<YuanShu> Error = new List<YuanShu>();
Error.Add(ys);
return Error;
}
}
#endregion
}
#endregion

if (CStack.Count != 0)
{
YuanShu ys = new YuanShu(LeiBie.CuoWu, "括号不匹配");
List<YuanShu> Error = new List<YuanShu>();
Error.Add(ys);
return Error;
}

return LChuLi;
}
/// <summary>
/// 中缀式转后缀式
/// </summary>
/// <param name="LChuLi"></param>
/// <returns></returns>
/// 将中缀表达式转换为后缀表达式的算法思想:
///·当读到数字直接送至输出队列中
///·当读到运算符t时,
///a.将栈中所有优先级高于或等于t的运算符弹出,送到输出队列中;
///b.t进栈
///·读到左括号时总是将它压入栈中
///·读到右括号时,将靠近栈顶的第一个左括号上面的运算符全部依次弹出,送至输出队列后,再丢弃左括号。
public static List<YuanShu> ToHouZhuiShi(List<YuanShu> LChuLi)
{
List<YuanShu> HouZhuiShi = new List<YuanShu>();
if (LChuLi[0].LB == LeiBie.CuoWu)
{
YuanShu ys = new YuanShu(LeiBie.CuoWu, "错误的表达式");
HouZhuiShi.Add(ys);
return HouZhuiShi;
}
Stack<YuanShu> NewStack = new Stack<YuanShu>();
string SSuanFuNow = "";
string SSuanFuSTop = "";
#region for循环开始
for (int i = 0; i < LChuLi.Count; i++)
{
#region switch-case开始
switch (LChuLi[i].LB)
{
case LeiBie.ShuZi:
//{
// HouZhuiShi.Add(LChuLi[i]);
// break;
//}
case LeiBie.BiaoShiFu:
{
HouZhuiShi.Add(LChuLi[i]);
break;
}
case LeiBie.SuanFu:
{
if (NewStack.Count == 0)
{
NewStack.Push(LChuLi[i]);
break;
}
while (NewStack.Count != 0)
{
SSuanFuNow = LChuLi[i].Zhi;
SSuanFuSTop = NewStack.Peek().Zhi;
if (BiJiao(SSuanFuSTop, SSuanFuNow) == '>')
{
HouZhuiShi.Add(NewStack.Pop());
}
else
{
break;
}
}
NewStack.Push(LChuLi[i]);
break;
}
case LeiBie.ZuoKuoHao:
{
NewStack.Push(LChuLi[i]);
break;
}
case LeiBie.YouKuoHao:
{
while (NewStack.Count != 0 && NewStack.Peek().LB != LeiBie.ZuoKuoHao)
{
HouZhuiShi.Add(NewStack.Pop());
}
if (NewStack.Count != 0)
{
NewStack.Pop();
}
break;
}
}
#endregion
}
#endregion
while (NewStack.Count != 0)
{
HouZhuiShi.Add(NewStack.Pop());
}
return HouZhuiShi;
}
/// <summary>
/// 计算后缀式的值
/// </summary>
/// <param name="HouZhuiShi"></param>
/// <returns></returns>
public static int JiSuan(List<YuanShu> HouZhuiShi)
{
Stack<Int32> JS = new Stack<Int32>();
for (int i = 0; i < HouZhuiShi.Count; i++)
{
switch (HouZhuiShi[i].LB)
{
case LeiBie.ShuZi:
{
JS.Push(Convert.ToInt32(HouZhuiShi[i].Zhi));
break;
}
case LeiBie.BiaoShiFu:
{
JS.Push(0);
break;
}
case LeiBie.SuanFu:
{
int JieGuo;
if (SiZeYunSuan(JS.Pop(), JS.Pop(), HouZhuiShi[i].Zhi, out JieGuo))
{
JS.Push(JieGuo);
break;
}
else
{
Console.WriteLine("不能除0");
return 0;
}
}
}
}
return JS.Pop();
}
/// <summary>
/// 四则运算操作数a,b,算符sf,结果c
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <param name="sf"></param>
/// <param name="c"></param>
/// <returns></returns>
public static bool SiZeYunSuan(int a, int b, string sf,out int c)
{
switch (sf)
{
case "+": c = b + a; return true;
case "-": c = b - a; return true;
case "*": c = b * a; return true;
case "div":
case "/":
{
if (a != 0)
{
c = b / a;
return true;
}
else
{
c = 0;
return false;
}
}
case "mod":
{
if (a != 0)
{
c = b % a;
return true;
}
else
{
c = 0;
return false;
}
}
default: c = 0; return false;
}
}
}
}

⑺ 老师给的例题,用Microsoft Visual Studio编的,这到底是C语言还是汇编啊

是C语言。不过程序的主要功能通过内嵌汇编完成。
“内嵌汇编”就是指,用_asm{}将汇编代码嵌入到C语言程序当中。
程序功能比较简单:先打印信息提示输入一个数,然后读入一个数,然后再打印信息提示输入另一个数,然后再读入一个数,然后比较两数是否相等并输出比较结果,然后提示程序结束,输入任意数按回车退出。
其中打印信息是调用printf,读入数据调用的scanf。
Visual Studio就是微软的集成开发环境,主要用来开发运行于windows的应用程序,具有(但不限于)编写、编译、调试C/C++程序的功能。

⑻ equals音标

iequal
[5i:kwEl]
adj.
相等的, 均等的, 胜任的, 平静的, 合适的, 不相上下的
n.
相等的事物(或数量), 对手, 匹敌, 同辈
vt.
等于, 比得上

equal
[5i:kw(E)l]
adj.
(常与to, with连用)相同的
cut the cake into six equal pieces
把蛋糕等分成六块
One li is equal to half a kilometre.
一华里等于半公里。
It is equal to me whether he comes or not.
他来不来对我都一样。
胜任的;经得起的
John is quite equal to the job of running the office.
约翰很能胜任主理这个办事处的工作。
He is equal to this task.; He is equal to doing this task.
他能胜任这项任务。

on equal terms
平等相处

equal
n.
同等的人,相等的人
equal
Lex x be the equal of y.
设x等于y。
Is he your equal in play chess?
他的棋艺跟你一样好吗?
vt.
-ll-; (AmE.) -l-
与…相等,等于
‘x = y’ means that x equals y. “x = y”
就是 x 与 y 相等。
Three and five equals eight.
三加五等于八。
Eight times eight equals sixty-four.
八乘八等于六十四。
比得上
None of us can equal her.
没人比得上她。

equal
[5i:kwEl]
adj.
相等的, 平等的, 均衡的(to, with); 同等的, 公正的, 公平的; 一样的
平稳的, 平静的
均匀的; 相当的
适合的; 胜任的, 经得起的; 足够的
equal pay for equal work
同工同酬
equal in ability
能力相等
divide sth. into twoequal parts
将某物二等分
equal time
[美](在无线电或电视广播中分配给不同政党候选人的)相等时间; (答辩控告或发表不同意见的)均等机会
All countries, big and small, should be equal.
国家不论大小, 一律平等。
He was equal to the occasion.
他能应付这个局势 。
She did not feel equal to receiving visitors.
她的身体不适, 不能接见客人。

equal
[5i:kwEl]
n.
同级别的人; 同辈
相等的事物[数量]
匹敌者; 可与比拟的东西
mix with one's equals and betters
与同你相等或比你更好的人交往
have no equal in music
在音乐方面没有人比得上
equal
[5i:kwEl]
vt.
(equal(l)ed; equal(l)ing)
比得上; 抵得过
等于
[古]使相等, 使平等[均]; 同等看待; 照样报答
He equals me in strength but not in intelligence.
他和我力气相等, 但智力不同。

equal-sign [mark]
n.
等号(=)

be equal to
等于; 与....相等
有...的能力[勇气, 力量等]
胜任, 能干
忍耐得住
be the equal to one's word
说到做到
be without equal
无比, 无敌
feel equal to
[口]能胜任, 有能力去做
other things being equal
在其它条件都相同的情况下

见 same

equal
来自拉丁语aequalis相等的<aequus平的

equal
.

⑼ Delphi 计算器,连续加减乘除问题

在加减乘除的处理过程的尾部,加上调用等号处理过程的句子。即如下:
procere TForm1.btnAddClick(Sender: TObject);
begin
Key := 1;
Temp1 := strtofloat(Edit1.text);
Edit1.Clear;
btnEqualClick(Sender);
end;

procere TForm1.btnMinusClick(Sender: TObject);
begin
Key := 2;
Temp1 := strtofloat(Edit1.Text);
Edit1.Clear;
btnEqualClick(Sender);
end;

procere TForm1.btnMultClick(Sender: TObject);
begin
Key := 3;
Temp1 := strtofloat(Edit1.Text);
Edit1.Clear;
btnEqualClick(Sender);
end;

procere TForm1.btnDiveClick(Sender: TObject);
begin
Key := 4;
Temp1 := strtofloat(Edit1.Text);
Edit1.Clear;
btnEqualClick(Sender);
end;

其实,你这个过程可以大大简化,方法是:
1、设置加减乘除四个按钮的属性tag分别为1~4
2、统一设置加减乘除的处理过程为Operate
procere TForm1.Operate(Sender: TObject);
begin
Key := TButton( Sender ).Tag;
Temp1 := strtofloat(Edit1.Text);
Edit1.Clear;
btnEqualClick(Sender);
end;
3、0~9和.的按钮也同样可以采用如上分别预设属性而统一处理过程的套路
0~9的tag分别为$30~$39,.的tag为$24,统一过程的内容是Edit1.Text := Edit1.Text + Chr( TButton( Sender ).Tag ) );

⑽ 求只需要加减乘除功能的简单的java计算器小程序!

package jisuanqi;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.BorderFactory;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;
import javax.swing.*;

/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Jisuan extends JFrame {
JPanel contentPane;
JButton btnmultiply = new JButton();
JButton btn3 = new JButton();
JButton btndivide = new JButton();
JButton btn2 = new JButton();
JButton btn5 = new JButton();
JButton btn0 = new JButton();
JButton btnclear = new JButton();
JButton btnequal = new JButton();
JButton btn1 = new JButton();
JButton btn6 = new JButton();
JButton bntplus = new JButton();
JButton btnminus = new JButton();
JButton btn4 = new JButton();
JButton btn9 = new JButton();
JButton btn8 = new JButton();
JButton btn7 = new JButton();
JPanel jPanel1 = new JPanel();
JTextField txt = new JTextField();
boolean flag=false;
String operand1;
String operand2;
double result;
String action;

public Jisuan() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}

/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(300, 400));
setTitle("Frame Title");
btnmultiply.setBounds(new Rectangle(227, 322, 42, 35));
btnmultiply.setText("+");
btnmultiply.addActionListener(new Jisuan_jButton1_actionAdapter(this));
contentPane.setBorder(BorderFactory.createEtchedBorder());
contentPane.setToolTipText("");
btn3.setBounds(new Rectangle(160, 263, 42, 35));
btn3.setText("3");
btn3.addActionListener(new Jisuan_btn3_actionAdapter(this));
btndivide.setBounds(new Rectangle(227, 263, 42, 35));
btndivide.setText("-");
btndivide.addActionListener(new Jisuan_jButton3_actionAdapter(this));
btn2.setBounds(new Rectangle(93, 263, 42, 35));
btn2.setText("2");
btn2.addActionListener(new Jisuan_btn2_actionAdapter(this));
btn5.setBounds(new Rectangle(93, 201, 42, 35));
btn5.setText("5");
btn5.addActionListener(new Jisuan_btn5_actionAdapter(this));
btn0.setBounds(new Rectangle(25, 322, 42, 35));
btn0.setText("0");
btn0.addActionListener(new Jisuan_btn0_actionAdapter(this));
btnclear.setBounds(new Rectangle(93, 322, 42, 35));
btnclear.setText("c");
btnclear.addActionListener(new Jisuan_jButton7_actionAdapter(this));
btnequal.setBounds(new Rectangle(160, 322, 42, 35));
btnequal.setText("=");
btnequal.addActionListener(new Jisuan_btnequal_actionAdapter(this));
btn1.setBounds(new Rectangle(25, 263, 42, 35));
btn1.setText("1");
btn1.addActionListener(new Jisuan_btn1_actionAdapter(this));
btn6.setBounds(new Rectangle(160, 201, 42, 35));
btn6.setText("6");
btn6.addActionListener(new Jisuan_btn6_actionAdapter(this));
bntplus.setBounds(new Rectangle(227, 201, 42, 35));
bntplus.setText("*");
bntplus.addActionListener(new Jisuan_btnminus_actionAdapter(this));
btnminus.setBounds(new Rectangle(227, 137, 42, 35));
btnminus.setText("/");
btnminus.addActionListener(new Jisuan_bntplus_actionAdapter(this));
btn4.setBounds(new Rectangle(25, 201, 42, 35));
btn4.setText("4");
btn4.addActionListener(new Jisuan_btn4_actionAdapter(this));
btn9.setBounds(new Rectangle(160, 137, 42, 35));
btn9.setText("9");
btn9.addActionListener(new Jisuan_btn9_actionAdapter(this));
btn8.setBounds(new Rectangle(93, 137, 42, 35));
btn8.setText("8");
btn8.addActionListener(new Jisuan_btn8_actionAdapter(this));
btn7.setBounds(new Rectangle(25, 137, 42, 35));
btn7.setText("7");
btn7.addActionListener(new Jisuan_btn7_actionAdapter(this));
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setBounds(new Rectangle(13, 128, 270, 244));
txt.setHorizontalAlignment(SwingConstants.RIGHT);
txt.setBounds(new Rectangle(13, 61, 270, 46));
contentPane.add(btndivide);
contentPane.add(btn3);
contentPane.add(btn2);
contentPane.add(btnclear);
contentPane.add(btnmultiply, null);
contentPane.add(btnequal);
contentPane.add(btn1);
contentPane.add(btn0);
contentPane.add(btn5);
contentPane.add(btn6);
contentPane.add(bntplus);
contentPane.add(btn4);
contentPane.add(btn7);
contentPane.add(btn8);
contentPane.add(btn9);
contentPane.add(btnminus);
contentPane.add(jPanel1);
contentPane.add(txt);
}

public void jButton1_actionPerformed(ActionEvent e) {
action="plus";
operand1=txt.getText();
txt.setText("");
flag=true;
}

public void jButton3_actionPerformed(ActionEvent e) {
action="minus";
operand1=txt.getText();
txt.setText("");
flag=true;
}

public void btn1_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn1.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn1.getActionCommand());
}
}
public void btn6_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn6.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn6.getActionCommand());
}
}
public void btn2_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn2.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn2.getActionCommand());
}
}
public void btn3_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn3.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn3.getActionCommand());
}
}
public void btn4_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn4.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn4.getActionCommand());
}
}
public void btn5_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn5.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn5.getActionCommand());
}
}
public void btn7_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn7.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn7.getActionCommand());
}
}
public void btn8_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn8.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn8.getActionCommand());
}
}
public void btn9_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn9.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn9.getActionCommand());
}
}
public void btn0_actionPerformed(ActionEvent e) {
if(flag){
txt.setText(btn0.getActionCommand());
flag=false;
}
else{
txt.setText(txt.getText()+btn0.getActionCommand());
}
}

public void jButton7_actionPerformed(ActionEvent e) {
txt.setText("");
}

public void bntplus_actionPerformed(ActionEvent e) {
/*
operand1=Integer.parseInt(txt.getText());
action="plus";
flag=true;
*/
action="divide";
operand1=txt.getText();
txt.setText("");
flag=true;
}

public void btnminus_actionPerformed(ActionEvent e) {
action="multiply";
operand1=txt.getText();
txt.setText("");
flag=true;
}

public void btnequal_actionPerformed(ActionEvent e) {
double digit1;
double digit2;
operand2=txt.getText();
if(flag==false){
if(action.equals("divide")){
digit1=Integer.parseInt(operand1);
digit2=Integer.parseInt(operand2);
result=digit1 / digit2;
txt.setText(new Double(result).toString());
flag=true;
}else if(action.equals("plus")){
digit1=Integer.parseInt(operand1);
digit2=Integer.parseInt(operand2);
result=digit1 + digit2;
txt.setText(""+(int)result);
flag=true;
}else if(action.equals("multiply")){
digit1=Integer.parseInt(operand1);
digit2=Integer.parseInt(operand2);
result=digit1 * digit2;
txt.setText(""+(int)result);
flag=true;
}else if(action.equals("minus")){
digit1=Integer.parseInt(operand1);
digit2=Integer.parseInt(operand2);
result=digit1-digit2;
txt.setText(""+(int)result);
flag=true;
}
}
}

}

class Jisuan_btnminus_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btnminus_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnminus_actionPerformed(e);
}
}

class Jisuan_bntplus_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_bntplus_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.bntplus_actionPerformed(e);
}
}

class Jisuan_jButton7_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_jButton7_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.jButton7_actionPerformed(e);
}
}

class Jisuan_btn0_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn0_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn0_actionPerformed(e);
}
}

class Jisuan_btn9_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn9_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn9_actionPerformed(e);
}
}

class Jisuan_btn8_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn8_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn8_actionPerformed(e);
}
}

class Jisuan_btn7_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn7_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn7_actionPerformed(e);
}
}

class Jisuan_btn6_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn6_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn6_actionPerformed(e);
}
}

class Jisuan_btn5_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn5_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn5_actionPerformed(e);
}
}

class Jisuan_btn4_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn4_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn4_actionPerformed(e);
}
}

class Jisuan_btn3_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn3_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn3_actionPerformed(e);
}
}

class Jisuan_btn2_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn2_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn2_actionPerformed(e);
}
}

class Jisuan_btn1_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btn1_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btn1_actionPerformed(e);
}
}

class Jisuan_jButton3_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_jButton3_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}

class Jisuan_jButton1_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_jButton1_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}

class Jisuan_btnequal_actionAdapter implements ActionListener {
private Jisuan adaptee;
Jisuan_btnequal_actionAdapter(Jisuan adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.btnequal_actionPerformed(e);
}
}
这个是实现的方法,按钮的名字不一定一样,最主要是这个要一样 action="minus";

main方法 用JB他自己就生成啦