結果

問題 No.9014 テストの合計点と平均点
ユーザー ウップス600ウップス600
提出日時 2022-01-04 20:31:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 2,578 ms
コンパイル使用メモリ 76,732 KB
実行使用メモリ 42,644 KB
最終ジャッジ日時 2024-04-22 17:17:40
合計ジャッジ時間 3,914 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
42,188 KB
testcase_01 AC 165 ms
42,568 KB
testcase_02 AC 163 ms
42,164 KB
testcase_03 AC 160 ms
42,644 KB
testcase_04 AC 167 ms
42,588 KB
testcase_05 AC 164 ms
42,436 KB
権限があれば一括ダウンロードができます

ソースコード

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];
		int x = 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 = (double)x / test. length;
		
		System. out. println ("平均点:" + (Math. floor (f * 10)) / 10);
	}
}
0