結果

問題 No.9013 台形の面積
ユーザー きつねうどんきつねうどん
提出日時 2024-03-13 19:18:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 2,198 ms
コンパイル使用メモリ 76,260 KB
実行使用メモリ 57,916 KB
最終ジャッジ日時 2024-03-13 19:18:11
合計ジャッジ時間 4,383 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
57,916 KB
testcase_01 AC 131 ms
57,672 KB
testcase_02 AC 127 ms
57,704 KB
testcase_03 AC 128 ms
57,676 KB
testcase_04 AC 138 ms
57,680 KB
testcase_05 AC 131 ms
57,724 KB
testcase_06 AC 136 ms
57,660 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 u = Integer.parseInt(strings[0]);
        int b = Integer.parseInt(strings[1]);
        int h = Integer.parseInt(strings[2]);
        double a = (double) ((u + b) * h) / 2;
        System.out.printf("%s", String.format("%.2f", a));
    }
}

0