結果

問題 No.480 合計
ユーザー yuiyui
提出日時 2017-02-20 10:32:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 2,222 ms
コンパイル使用メモリ 71,972 KB
実行使用メモリ 56,504 KB
最終ジャッジ日時 2023-08-21 01:36:51
合計ジャッジ時間 5,897 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,212 KB
testcase_01 AC 123 ms
56,504 KB
testcase_02 AC 121 ms
56,044 KB
testcase_03 AC 119 ms
55,944 KB
testcase_04 AC 118 ms
55,912 KB
testcase_05 AC 120 ms
56,292 KB
testcase_06 AC 122 ms
55,784 KB
testcase_07 AC 117 ms
56,260 KB
testcase_08 AC 117 ms
56,300 KB
testcase_09 AC 117 ms
56,304 KB
testcase_10 AC 117 ms
55,968 KB
testcase_11 AC 118 ms
56,348 KB
testcase_12 AC 115 ms
56,232 KB
testcase_13 AC 117 ms
55,980 KB
testcase_14 AC 118 ms
54,388 KB
testcase_15 AC 123 ms
56,240 KB
testcase_16 AC 122 ms
55,880 KB
testcase_17 AC 118 ms
55,912 KB
testcase_18 AC 120 ms
56,328 KB
testcase_19 AC 119 ms
56,068 KB
testcase_20 AC 119 ms
55,484 KB
testcase_21 AC 117 ms
55,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

    	Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
    	int ans = 0;
    	for(int i=1;i<=num;i++){
    		ans += i;
    	}
    	System.out.println(ans);
    }

}
0