結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー _k_a_n_i__k_a_n_i_
提出日時 2015-04-23 17:31:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 571 bytes
コンパイル時間 1,929 ms
コンパイル使用メモリ 72,400 KB
実行使用メモリ 56,072 KB
最終ジャッジ日時 2023-09-18 08:35:28
合計ジャッジ時間 2,996 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,816 KB
testcase_01 AC 122 ms
56,072 KB
testcase_02 AC 127 ms
55,736 KB
testcase_03 AC 129 ms
55,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main
{
    private final static Main main = new Main();

    public static void main(String[] args)
    {
        long l = System.currentTimeMillis();
        main.solve();
        //System.out.println("処理時間:" + (System.currentTimeMillis() - l));
    }

    private void solve()
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i=1; i<=n; ++i)
        {
            System.out.println(i%15 == 0 ? "FizzBuzz" : i%3 == 0 ? "Fizz" : i%5 == 0 ? "Buzz" : i);
        }
    }
}
0