标签:res port inpu void input cond second first main
源代码:
import javax.swing.JOptionPane;
public class Addition{
public static void main(String [] args){
String firstNumber,secondNumber;
int number1,number2,sum,differ,pro,quo;
firstNumber = JOptionPane.showInputDialog("输入第一个数");
secondNumber = JOptionPane.showInputDialog("输入第二个数");
number1 = Integer.parseInt(firstNumber);
number2 = Integer.parseInt(secondNumber);
sum = number1 + number2;
differ = number1 - number2;
pro = number1 * number2;
quo = number1/number2;
JOptionPane.showMessageDialog(null,"和是:"+sum,"Results",
JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog(null,"差是:"+differ,"Results",
JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog(null,"积是:"+pro,"Results",
JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog(null,"商是:"+quo,"Results",
JOptionPane.PLAIN_MESSAGE);
System.exit( 0 );
}
}
标签:res port inpu void input cond second first main
原文地址:http://www.cnblogs.com/wjwjs/p/7642945.html