結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-02 17:43:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 71,744 KB
実行使用メモリ 56,260 KB
最終ジャッジ日時 2023-08-18 12:20:39
合計ジャッジ時間 3,024 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        for(int i=1; i<=N; i++){
            if(i%3==0&&i%5==0){
                System.out.println("FizzBuzz");
            }else if(i%3==0){
                System.out.println("Fizz");
            }else if(i%5==0){
                System.out.println("Buzz");
            }else{
                System.out.println(i);
            }
        }
    }
}
0