結果

問題 No.480 合計
ユーザー S1hoS1ho
提出日時 2017-02-28 14:56:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 3,770 ms
コンパイル使用メモリ 71,340 KB
実行使用メモリ 56,940 KB
最終ジャッジ日時 2023-08-21 01:38:40
合計ジャッジ時間 6,948 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
56,280 KB
testcase_01 AC 137 ms
55,692 KB
testcase_02 AC 135 ms
56,336 KB
testcase_03 AC 134 ms
55,956 KB
testcase_04 AC 129 ms
56,940 KB
testcase_05 AC 131 ms
56,528 KB
testcase_06 AC 131 ms
55,984 KB
testcase_07 AC 133 ms
56,108 KB
testcase_08 AC 136 ms
56,028 KB
testcase_09 AC 135 ms
56,608 KB
testcase_10 AC 130 ms
56,244 KB
testcase_11 AC 131 ms
56,360 KB
testcase_12 AC 130 ms
56,280 KB
testcase_13 AC 132 ms
55,960 KB
testcase_14 AC 135 ms
56,400 KB
testcase_15 AC 134 ms
56,172 KB
testcase_16 AC 133 ms
56,304 KB
testcase_17 AC 131 ms
55,952 KB
testcase_18 AC 132 ms
56,048 KB
testcase_19 AC 137 ms
56,036 KB
testcase_20 AC 138 ms
56,008 KB
testcase_21 AC 136 ms
56,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        float n = scanner.nextFloat();
        
        int sum = 0;
        
        for(int i=1;i<=n;i++){
            sum += i;
        }
        
        System.out.println(sum);
    }
    
}
0