java.util.Scanner类
import java.util.Scanner; class Challenge{ public static void main(String args[]){ Scanner scanner=new Scanner(System.in); int product=0; System.out.println("Enter the 1st number:"); int num1=scanner.nextInt(); System.out.println("Enter the 2nd number:"); int num2=scanner.nextInt(); { product=num1*num2; } System.out.println("The product of the two numbers is:"+product); } }
5,enter键
7,enter键