用Java编写一个程序,输入a.b.c三个值,输出三个数的和及乘积,急求
展开全部
package test;
import java.util.Scanner;
public class Demo1 {
public static void main(String[] args) {
System.out.println("请输入第一个值:");
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
System.out.println("请输入第二个值:");
scan = new Scanner(System.in);
int b = scan.nextInt();
System.out.println("请输入第三个值:");
scan = new Scanner(System.in);
int c = scan.nextInt();
System.out.println("三个数之和为:" + (a + b + c));
System.out.println("三个数之积为:" + (a * b * c));
}
}
追问
棒棒哒
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询