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

📄 multiplynumbers.java

📁 《A first book of java》by Gary J.Bronson 北大出版社
💻 JAVA
字号:
import java.io.*;   // needed to access input stream classes
public class MultiplyNumbers
{
  public static void main (String[] args) 
  throws java.io.IOException
  {
    String s1;
    String s2;
    double num1, num2, product;
    // set up the basic input stream
      // needed for conversion capabilities  
    InputStreamReader isr = new InputStreamReader(System.in);
      // needed to use ReadLine()
    BufferedReader br = new BufferedReader(isr);
     
    System.out.print("Enter a number: ");
    s1 = br.readLine();
    num1 = Double.parseDouble(s1);
     
    System.out.print("Great! Now enter another number: ");
    s2 = br.readLine();
    num2 = Double.parseDouble(s2);
     
    product = num1 * num2;   
    System.out.println(num1 + " times " + num2 + " is " + product);
  }
}

⌨️ 快捷键说明

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