ex2_9.java

来自「Introduction to java programming 一书中所有编程」· Java 代码 · 共 27 行

JAVA
27
字号
import javax.swing.JOptionPane;/* * To change this template, choose Tools | Templates * and open the template in the editor. *//** * * @author xiaolei */public class EX2_9 {    public static void main(String[] args) {        double s1, s2, s3;        s1 = Double.parseDouble(JOptionPane.showInputDialog("边1:"));        s2 = Double.parseDouble(JOptionPane.showInputDialog("边2:"));        s3 = Double.parseDouble(JOptionPane.showInputDialog("边3:"));                boolean result = (s1+s2)>s3 && (s1+s3)>s2 && (s2+s3)>s1;                System.out.println("Can edges["+s1+","+s2+","+s3+"] form a triangle? " + result);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?