結果

問題 No.480 合計
ユーザー wnwwwnwnwwwn
提出日時 2020-04-02 06:44:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 3,589 ms
コンパイル使用メモリ 71,924 KB
実行使用メモリ 57,648 KB
最終ジャッジ日時 2023-09-10 08:19:21
合計ジャッジ時間 7,265 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,592 KB
testcase_01 AC 130 ms
55,628 KB
testcase_02 AC 126 ms
55,452 KB
testcase_03 AC 127 ms
55,796 KB
testcase_04 AC 125 ms
57,648 KB
testcase_05 AC 124 ms
55,500 KB
testcase_06 AC 125 ms
55,448 KB
testcase_07 AC 124 ms
55,776 KB
testcase_08 AC 125 ms
55,264 KB
testcase_09 AC 125 ms
55,600 KB
testcase_10 AC 128 ms
55,184 KB
testcase_11 AC 128 ms
55,624 KB
testcase_12 AC 128 ms
55,484 KB
testcase_13 AC 126 ms
55,552 KB
testcase_14 AC 129 ms
55,416 KB
testcase_15 AC 126 ms
55,416 KB
testcase_16 AC 128 ms
55,556 KB
testcase_17 AC 128 ms
55,708 KB
testcase_18 AC 125 ms
55,868 KB
testcase_19 AC 124 ms
55,220 KB
testcase_20 AC 125 ms
55,784 KB
testcase_21 AC 124 ms
55,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No480 {
	public static void main(String[] args) {
		//Scannerを使用し、入力
		Scanner sr = new Scanner(System.in);

		//iを入力
		int i = sr.nextInt();

		//ans 初期化
		int ans = 0;

		for (; i <= 100; i--) {
			ans = ans + i;

			if (i == 0) {
				break;
			}
		}
		System.out.println(ans);
	}
}
0