题目描述
已知某位学生的数学、英语和计算机课程的成绩,求该生三门课程的平均分。
输入
输入三个整数,数据之间由空格隔开。
输出
输出占一行,包含一个实数,为三门课的平均分,保留两位小数。
样例输入
87 73 93
样例输出
84.33
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int math = in.nextInt(),
english = in.nextInt(),
computer = in.nextInt();
System.out.printf("%.2f",(math + english + computer) / 3.0);
//直接输出时注意转化成浮点数
}
}