結果

問題 No.9014 テストの合計点と平均点
ユーザー きつねうどん
提出日時 2024-03-13 19:10:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 74,740 KB
実行使用メモリ 54,480 KB
最終ジャッジ日時 2024-09-29 22:54:18
合計ジャッジ時間 3,181 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

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