結果

問題 No.9014 テストの合計点と平均点
ユーザー きつねうどんきつねうどん
提出日時 2024-03-13 19:10:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 9,045 ms
コンパイル使用メモリ 84,000 KB
実行使用メモリ 58,212 KB
最終ジャッジ日時 2024-03-13 19:10:51
合計ジャッジ時間 4,391 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
56,040 KB
testcase_01 AC 138 ms
57,672 KB
testcase_02 AC 140 ms
57,928 KB
testcase_03 AC 140 ms
58,188 KB
testcase_04 AC 141 ms
58,212 KB
testcase_05 AC 142 ms
58,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        String[] strings = S.split(",");
        int j = Integer.parseInt(strings[0]);
        int m = Integer.parseInt(strings[1]);
        int b = Integer.parseInt(strings[2]);
        System.out.printf("合計点:%d\n", j+m+b);
        double average = (double)(j + m + b) / 3;
        ;
        System.out.printf("平均点:%s",String.format("%.1f",average));
    }
}

0