题解 | 牛牛学立体
牛牛学立体
https://www.nowcoder.com/practice/3d0bd5e060154211bddc1ee892714df0
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
while (in.hasNextInt()) { // 注意 while 处理多个 case
int a = in.nextInt();
int b = in.nextInt();
int c = in.nextInt();
int s = 2*(a*b + b*c + c*a);
int v = a*b*c;
System.out.println(s+"\n"+v);
}
}
}
查看13道真题和解析