結果

問題 No.480 合計
ユーザー _araran__araran_
提出日時 2018-04-20 18:42:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 1,859 ms
コンパイル使用メモリ 71,456 KB
実行使用メモリ 56,704 KB
最終ジャッジ日時 2023-09-09 12:03:13
合計ジャッジ時間 5,920 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,668 KB
testcase_01 AC 119 ms
55,936 KB
testcase_02 AC 119 ms
55,704 KB
testcase_03 AC 120 ms
55,872 KB
testcase_04 AC 118 ms
55,548 KB
testcase_05 AC 119 ms
55,620 KB
testcase_06 AC 119 ms
55,628 KB
testcase_07 AC 120 ms
55,748 KB
testcase_08 AC 119 ms
55,552 KB
testcase_09 AC 117 ms
56,704 KB
testcase_10 AC 119 ms
55,636 KB
testcase_11 AC 121 ms
55,636 KB
testcase_12 AC 120 ms
55,316 KB
testcase_13 AC 119 ms
55,824 KB
testcase_14 AC 119 ms
55,116 KB
testcase_15 AC 119 ms
55,628 KB
testcase_16 AC 119 ms
55,776 KB
testcase_17 AC 119 ms
55,916 KB
testcase_18 AC 120 ms
55,832 KB
testcase_19 AC 119 ms
55,684 KB
testcase_20 AC 119 ms
55,836 KB
testcase_21 AC 119 ms
55,440 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();
        int ret = 0; 
        
        for (; a> 0; a--) {
             ret = ret + a;
         }

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

0