题目描述
已知某位学生的数学、英语和计算机课程的成绩,求该生三门课程的平均分。
输入
输入三个整数,数据之间由空格隔开。
输出
输出占一行,包含一个实数,为三门课的平均分,保留两位小数。
样例输入 Copy
87 73 93
样例输出 Copy
84.33
来源/分类
*
代码
import java.util.Scanner;
public class Main {
public static final double rate = 6.5573;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a, b, c;
double x;
while (sc.hasNext()) {
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
x = (a + b + c) / 3.0;
System.out.print(String.format("%.2f", x));
}
}
}