結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー yuuki121yuuki121
提出日時 2020-12-16 11:18:02
言語 Java21
(openjdk 21)
結果
OLE  
実行時間 -
コード長 490 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 75,396 KB
実行使用メモリ 63,300 KB
最終ジャッジ日時 2023-10-20 09:17:28
合計ジャッジ時間 14,955 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 OLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		// int 1つ分を読み込む
		int a = sc.nextInt();

		StringBuilder sb = new StringBuilder();

		for (int i = 1; i <= a; a++) {
			if (a % 3 == 0) {
				sb.append("Fizz");
			}
			if (a % 5 == 0) {
				sb.append("Buzz");
			}
			System.out.print(sb.toString());
		}


	}
}
0