結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー LR_Alumis
提出日時 2015-04-14 01:37:05
言語 Java
(openjdk 23)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 540 bytes
コンパイル時間 3,367 ms
コンパイル使用メモリ 74,680 KB
実行使用メモリ 41,308 KB
最終ジャッジ日時 2024-07-04 14:22:06
合計ジャッジ時間 3,767 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class FizzBuzz {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int count = input.nextInt();
        for(int i=1; i<=count; 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