結果

問題 No.480 合計
ユーザー tsunabittsunabit
提出日時 2018-03-03 23:49:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 772 bytes
コンパイル時間 3,447 ms
コンパイル使用メモリ 71,492 KB
実行使用メモリ 55,968 KB
最終ジャッジ日時 2023-09-18 12:28:30
合計ジャッジ時間 7,146 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,804 KB
testcase_01 AC 126 ms
55,804 KB
testcase_02 AC 126 ms
55,780 KB
testcase_03 AC 127 ms
55,924 KB
testcase_04 AC 127 ms
55,524 KB
testcase_05 AC 126 ms
55,760 KB
testcase_06 AC 127 ms
55,644 KB
testcase_07 AC 125 ms
55,704 KB
testcase_08 AC 124 ms
55,868 KB
testcase_09 AC 126 ms
55,580 KB
testcase_10 AC 127 ms
55,808 KB
testcase_11 AC 125 ms
55,740 KB
testcase_12 AC 127 ms
55,840 KB
testcase_13 AC 127 ms
55,552 KB
testcase_14 AC 125 ms
55,940 KB
testcase_15 AC 128 ms
55,968 KB
testcase_16 AC 134 ms
55,632 KB
testcase_17 AC 127 ms
55,728 KB
testcase_18 AC 126 ms
55,848 KB
testcase_19 AC 127 ms
55,748 KB
testcase_20 AC 126 ms
55,820 KB
testcase_21 AC 127 ms
55,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

//No.480 合計
public class No480 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        // int 1つ分を読み込む
        // int a = sc.nextInt();
        // int 1つ分を読み込む
        // int b = sc.nextInt();
        // String 1つ分を読み込む
        // String s = sc.next();
        // 標準出力に書き出す。
        //System.out.println((a + b) + " " + s);
        int num = sc.nextInt();
        //System.out.println("tet = " + num);
        int total = 0;
        for(int i = 0; i <= num; i++){
            total += i;
        }
        System.out.println(total);
    }
}
0