結果

問題 No.480 合計
ユーザー ambasad
提出日時 2019-11-15 17:36:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 2,432 ms
コンパイル使用メモリ 74,232 KB
実行使用メモリ 54,292 KB
最終ジャッジ日時 2024-09-24 23:08:16
合計ジャッジ時間 5,453 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
       Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();

        int n = Integer.parseInt(str);
        int sum = 0;

        for(int i=1; i<=n; i++) {
            sum += i;
        }

        System.out.println(sum);
        scan.close();
	}
}
0