結果

問題 No.480 合計
ユーザー ShotaroSuzu
提出日時 2020-05-19 17:11:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 2,355 ms
コンパイル使用メモリ 77,824 KB
実行使用メモリ 54,152 KB
最終ジャッジ日時 2024-10-01 22:53:13
合計ジャッジ時間 6,108 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder.tutorial.sum;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);

		long inNum = sc.nextInt();

		long sum = 0L;
		for (int i = 1; i <= inNum; i++) {
			sum += i;
		}
		System.out.println(sum);
	}

}
0