⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hypotenuse.java

📁 java版的数据结构的完全代码 免费提供了 学习数据结构的请下载
💻 JAVA
字号:
// Introduced in Chapter 4/** Compute the hypotenuse of a right triangle. */public class Hypotenuse {  /** Return the square of the number x. */  public static double square(double x) {    return x * x;  }  /**   * Return the hypotenuse of a right triangle with side lengths x   * and y.   */  public static double hypotenuse(double x, double y) {    double x2 = square(x);    double y2 = square(y);    return Math.sqrt(x2 + y2);  }  /** Test the methods. */  public static void main(String[] args) {    double result = hypotenuse(3, 4);    System.out.println(result);  }  }

⌨️ 快捷键说明

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