62,623
社区成员
发帖
与我相关
我的任务
分享
import javax.swing.JOptionPane;
public class A004 {
public void inputSomething(){
try {
int[] tmp = new int[2];
for(int i=0;i<tmp.length;i++){
tmp[i] = Integer.parseInt(JOptionPane.showInputDialog(null,"输入第" + (i+1) + "个数"));
}
if(tmp[0] == tmp[1]){
System.out.println("tmp[0] = " + tmp[0] + " == " + "tmp[1] = " + tmp[1]);
}
else{
System.out.println("tmp[0] = " + tmp[0] + " != " + "tmp[1] = " + tmp[1]);
}
} catch (Exception e) {
System.out.println("输入不合法!");
// e.printStackTrace();
}
}
public static void main(String[] args) {
new A004().inputSomething();
}
}