在一行中输入三个非负整数
,分别表示牛牛的作业成绩、小测成绩和期末考试成绩。且保证
均为
的整数倍。
输出一个整数
,表示牛牛的总成绩,满分为
。
100 100 100
100
。
70 80 90
83
。
本题已于下方时间节点更新,请注意题解时效性:
1. 2025-06-03 优化题面文本与格式。
2. 2025-11-20 优化题面文本与格式。
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();
System.out.printf("%.0f",a*0.2+b*0.3+c*0.5);
}
}
}