結果

問題 No.480 合計
ユーザー shiyo1023shiyo1023
提出日時 2019-09-01 05:04:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 4,945 ms
コンパイル使用メモリ 71,048 KB
実行使用メモリ 56,472 KB
最終ジャッジ日時 2023-08-18 02:45:46
合計ジャッジ時間 6,784 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,912 KB
testcase_01 AC 121 ms
56,120 KB
testcase_02 AC 122 ms
55,968 KB
testcase_03 AC 122 ms
55,768 KB
testcase_04 AC 121 ms
55,724 KB
testcase_05 AC 121 ms
56,472 KB
testcase_06 AC 122 ms
56,096 KB
testcase_07 AC 122 ms
55,828 KB
testcase_08 AC 123 ms
56,212 KB
testcase_09 AC 123 ms
55,772 KB
testcase_10 AC 122 ms
55,988 KB
testcase_11 AC 122 ms
55,728 KB
testcase_12 AC 122 ms
55,912 KB
testcase_13 AC 121 ms
56,224 KB
testcase_14 AC 122 ms
56,392 KB
testcase_15 AC 122 ms
55,768 KB
testcase_16 AC 121 ms
55,800 KB
testcase_17 AC 121 ms
55,928 KB
testcase_18 AC 122 ms
55,548 KB
testcase_19 AC 120 ms
56,180 KB
testcase_20 AC 122 ms
56,164 KB
testcase_21 AC 120 ms
56,036 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 a = sc.nextInt();

        // String 1つ分を読み込む
        // String s = sc.next();

        int sum = 0;
        
        for (int i=1; i<=a; i++)
        {
            sum = sum + i;
        }

        // 標準出力に書き出す。
        System.out.println(sum);
    }
}
0