結果

問題 No.480 合計
ユーザー kenickenic
提出日時 2018-03-16 16:55:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 3,421 ms
コンパイル使用メモリ 71,364 KB
実行使用メモリ 56,028 KB
最終ジャッジ日時 2023-08-23 11:50:33
合計ジャッジ時間 6,531 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,628 KB
testcase_01 AC 123 ms
55,492 KB
testcase_02 AC 121 ms
53,780 KB
testcase_03 AC 123 ms
55,780 KB
testcase_04 AC 124 ms
55,520 KB
testcase_05 AC 124 ms
55,620 KB
testcase_06 AC 122 ms
55,452 KB
testcase_07 AC 122 ms
55,616 KB
testcase_08 AC 122 ms
55,844 KB
testcase_09 AC 123 ms
55,672 KB
testcase_10 AC 124 ms
55,980 KB
testcase_11 AC 124 ms
55,716 KB
testcase_12 AC 124 ms
55,480 KB
testcase_13 AC 125 ms
55,888 KB
testcase_14 AC 123 ms
55,516 KB
testcase_15 AC 123 ms
55,620 KB
testcase_16 AC 124 ms
55,988 KB
testcase_17 AC 121 ms
55,672 KB
testcase_18 AC 126 ms
56,028 KB
testcase_19 AC 123 ms
55,740 KB
testcase_20 AC 127 ms
55,856 KB
testcase_21 AC 122 ms
55,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        int num = Integer.parseInt(input);
        int sum = 0;

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