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键

posted @ 2015-02-07 16:42  闲来垂钓  阅读(148)  评论(0编辑  收藏  举报