結果

問題 No.480 合計
ユーザー Ryota EnokidoRyota Enokido
提出日時 2018-12-09 19:44:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 2,453 ms
コンパイル使用メモリ 72,124 KB
実行使用メモリ 55,824 KB
最終ジャッジ日時 2023-10-14 14:30:00
合計ジャッジ時間 6,636 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,620 KB
testcase_01 AC 126 ms
55,564 KB
testcase_02 AC 127 ms
55,592 KB
testcase_03 AC 128 ms
55,756 KB
testcase_04 AC 127 ms
53,840 KB
testcase_05 AC 126 ms
55,620 KB
testcase_06 AC 126 ms
55,620 KB
testcase_07 AC 130 ms
55,684 KB
testcase_08 AC 128 ms
55,580 KB
testcase_09 AC 129 ms
55,824 KB
testcase_10 AC 126 ms
55,676 KB
testcase_11 AC 129 ms
55,608 KB
testcase_12 AC 128 ms
55,596 KB
testcase_13 AC 128 ms
55,564 KB
testcase_14 AC 127 ms
55,344 KB
testcase_15 AC 128 ms
55,568 KB
testcase_16 AC 128 ms
55,564 KB
testcase_17 AC 128 ms
55,736 KB
testcase_18 AC 129 ms
55,672 KB
testcase_19 AC 132 ms
55,760 KB
testcase_20 AC 127 ms
55,716 KB
testcase_21 AC 125 ms
55,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        // int 1つ分を読み込む
        int Sum = 0;
        int a = sc.nextInt();
        for(int i=1;i<=a;i++){
            Sum += i;
        }
        
        System.out.println(Sum);
    }
}
0