結果

問題 No.480 合計
ユーザー yoneoka1985yoneoka1985
提出日時 2018-10-10 20:30:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 1,852 ms
コンパイル使用メモリ 74,088 KB
実行使用メモリ 41,584 KB
最終ジャッジ日時 2024-04-20 19:29:43
合計ジャッジ時間 5,282 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,480 KB
testcase_01 AC 112 ms
41,060 KB
testcase_02 AC 118 ms
41,512 KB
testcase_03 AC 114 ms
41,340 KB
testcase_04 AC 119 ms
41,468 KB
testcase_05 AC 121 ms
41,440 KB
testcase_06 AC 112 ms
41,496 KB
testcase_07 AC 111 ms
41,584 KB
testcase_08 AC 115 ms
41,552 KB
testcase_09 AC 106 ms
40,148 KB
testcase_10 AC 116 ms
41,388 KB
testcase_11 AC 105 ms
40,496 KB
testcase_12 AC 117 ms
41,560 KB
testcase_13 AC 118 ms
41,244 KB
testcase_14 AC 116 ms
41,220 KB
testcase_15 AC 112 ms
41,276 KB
testcase_16 AC 112 ms
41,224 KB
testcase_17 AC 106 ms
40,004 KB
testcase_18 AC 112 ms
41,564 KB
testcase_19 AC 114 ms
41,268 KB
testcase_20 AC 117 ms
41,300 KB
testcase_21 AC 107 ms
40,104 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 n = sc.nextInt();
        int a = 0;
        for(int i=1;i<=n;i++){
            a +=i;
        }

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