結果
問題 |
No.9014 テストの合計点と平均点
|
ユーザー |
|
提出日時 | 2022-01-04 20:31:07 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 165 ms / 2,000 ms |
コード長 | 570 bytes |
コンパイル時間 | 2,264 ms |
コンパイル使用メモリ | 75,724 KB |
実行使用メモリ | 42,428 KB |
最終ジャッジ日時 | 2024-10-14 16:28:25 |
合計ジャッジ時間 | 4,022 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 |
ソースコード
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); } }