結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー kenji_shioyakenji_shioya
提出日時 2016-07-08 16:19:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 3,138 ms
コンパイル使用メモリ 72,608 KB
実行使用メモリ 56,608 KB
最終ジャッジ日時 2023-09-29 22:34:01
合計ジャッジ時間 8,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,168 KB
testcase_01 AC 120 ms
56,248 KB
testcase_02 AC 121 ms
56,240 KB
testcase_03 AC 121 ms
56,056 KB
testcase_04 AC 126 ms
54,428 KB
testcase_05 AC 124 ms
56,376 KB
testcase_06 AC 128 ms
56,588 KB
testcase_07 AC 128 ms
56,156 KB
testcase_08 AC 128 ms
56,316 KB
testcase_09 AC 133 ms
56,112 KB
testcase_10 AC 119 ms
56,008 KB
testcase_11 AC 125 ms
56,604 KB
testcase_12 AC 123 ms
56,104 KB
testcase_13 AC 119 ms
56,100 KB
testcase_14 AC 124 ms
56,092 KB
testcase_15 AC 128 ms
56,232 KB
testcase_16 AC 120 ms
54,340 KB
testcase_17 AC 119 ms
56,224 KB
testcase_18 AC 127 ms
56,120 KB
testcase_19 AC 123 ms
56,256 KB
testcase_20 AC 120 ms
56,608 KB
testcase_21 AC 119 ms
56,212 KB
testcase_22 AC 123 ms
55,784 KB
testcase_23 AC 128 ms
56,220 KB
testcase_24 AC 129 ms
56,404 KB
testcase_25 AC 120 ms
56,152 KB
testcase_26 AC 120 ms
56,420 KB
testcase_27 AC 123 ms
56,120 KB
testcase_28 AC 124 ms
56,152 KB
testcase_29 AC 128 ms
55,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.BigDecimal;

public class Exercise147{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    BigDecimal sum = new BigDecimal("0.0000000000");
    for(int i = 0; i < n; i++){
      BigDecimal num = new BigDecimal(sc.next());
      sum = sum.add(num);
    }
    System.out.println(sum.toPlainString());
  }
}
0