import java.util.*;
public class Example2_4{
public static void main(String args[]){
Scanner reader=new Scanner(System.in);
int product=1;
int total=0;
System.out.println("请输入整数:");
while(reader.hasNextInt()){
int x=reader.nextInt();
total=total+1;
product=product*x;
}
System.out.printf("%d个数的乘积为%d\n",total,product);
}
}
转载于:https://www.cnblogs.com/Nephalem/archive/2013/03/07/2948778.html