結果

問題 No.480 合計
ユーザー Higashi HiroyukiHigashi Hiroyuki
提出日時 2020-06-03 23:00:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 5,599 ms
コンパイル使用メモリ 71,908 KB
実行使用メモリ 56,968 KB
最終ジャッジ日時 2023-08-17 11:43:44
合計ジャッジ時間 6,639 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,168 KB
testcase_01 AC 120 ms
56,552 KB
testcase_02 AC 120 ms
56,480 KB
testcase_03 AC 126 ms
56,072 KB
testcase_04 AC 116 ms
55,820 KB
testcase_05 AC 119 ms
55,704 KB
testcase_06 AC 120 ms
56,156 KB
testcase_07 AC 119 ms
56,200 KB
testcase_08 AC 117 ms
56,968 KB
testcase_09 AC 116 ms
55,728 KB
testcase_10 AC 117 ms
56,792 KB
testcase_11 AC 117 ms
56,448 KB
testcase_12 AC 117 ms
56,172 KB
testcase_13 AC 119 ms
56,176 KB
testcase_14 AC 120 ms
56,376 KB
testcase_15 AC 118 ms
55,708 KB
testcase_16 AC 118 ms
55,668 KB
testcase_17 AC 121 ms
54,400 KB
testcase_18 AC 117 ms
56,120 KB
testcase_19 AC 117 ms
56,176 KB
testcase_20 AC 116 ms
56,068 KB
testcase_21 AC 116 ms
55,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Addition {
  public static void main(String[] args) {
    int sum = 0;

    Scanner scanner = new Scanner(System.in);

    int num = scanner.nextInt();

    for (int i = 0; i <= num; i++) {
      sum += i;
    }
    System.out.println(sum);
  }
  
}
0