結果

問題 No.369 足し間違い
ユーザー kenji_shioyakenji_shioya
提出日時 2016-05-26 23:52:39
言語 Java
(openjdk 23)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 3,462 ms
コンパイル使用メモリ 77,056 KB
実行使用メモリ 58,284 KB
最終ジャッジ日時 2024-10-07 16:23:17
合計ジャッジ時間 5,592 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

    Scanner sc = new Scanner(System.in);

    int numberOfNum = sc.nextInt();

    int[] nums = new int[numberOfNum];

    for (int n = 0; n < numberOfNum; n++){
      nums[n] = sc.nextInt();
    }

    int wrongAnswer = sc.nextInt();

    int sum = 0;

    for (int n = 0; n < numberOfNum; n++){
      sum += nums[n];
    }

    System.out.println(sum - wrongAnswer);
  }
}
0