题目描述
输入3科成绩,然后把三科成绩输出,成绩为整数形式。
输入描述:
一行,3科成绩,用空格分隔,范围(0~100)。
输出描述:
一行,把3科成绩显示出来,输出格式详见输出样例。
示例1
输入
60 80 90
输出
score1=60,score2=80,score3=90
import java.util.Scanner;
public class Bc9 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double number = 0;
double c_score = 0.f, math_score = 0.f, english_score = 0.f;
number = sc.nextDouble();
c_score = sc.nextDouble();
math_score = sc.nextDouble();
english_score = sc.nextDouble();
System.out.printf(
"The each subject score of No. %d is %.2f, %.2f, %.2f.\n",
number, c_score, math_score, english_score);
}
}