結果

問題 No.480 合計
ユーザー Ryota Enokido
提出日時 2018-12-09 19:44:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 73,996 KB
実行使用メモリ 41,308 KB
最終ジャッジ日時 2024-09-16 09:06:19
合計ジャッジ時間 5,555 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        // int 1つ分を読み込む
        int Sum = 0;
        int a = sc.nextInt();
        for(int i=1;i<=a;i++){
            Sum += i;
        }
        
        System.out.println(Sum);
    }
}
0