結果

問題 No.9014 テストの合計点と平均点
ユーザー ウップス600ウップス600
提出日時 2022-01-04 20:24:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 2,070 ms
コンパイル使用メモリ 76,364 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-04-22 17:11:35
合計ジャッジ時間 3,501 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java. util. Scanner;

public class Main{
	public static void main (String[] args){
		Scanner scanner = new Scanner (System. in);
		Double[] test = new Double[3];
		Double x = 0.0;
		String answer = scanner. next();
		String[] a = answer. split (",");

		for (int j = 0; j < test. length; j ++){
			test[j] = Double. parseDouble (a[j]);
		}
		
		for (int j = 0; j < test. length; j ++){
			x += test[j];
		}
		System. out. println ("合計点:" + x);
		
		double f = x / test. length;
		
		System. out. println ("平均点:" + (Math. floor (f * 10)) / 10);
	}
}
0