結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー fog_878fog_878
提出日時 2019-03-15 22:11:53
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 2,687 ms
コンパイル使用メモリ 75,204 KB
実行使用メモリ 56,924 KB
最終ジャッジ日時 2023-09-14 13:42:06
合計ジャッジ時間 3,492 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class Main {

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

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		sc.close();

        for(int i=1; i<=n;i++){
            String S = "";
    		if(n%3==0)S+="Fizz";
    		if(n%5==0)S+="Buzz";
    		else S+=n;
    		System.out.println(S);
        }

	}

}
0