結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー chiyochiyo
提出日時 2015-05-22 03:37:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 3,251 ms
コンパイル使用メモリ 77,056 KB
実行使用メモリ 41,596 KB
最終ジャッジ日時 2024-07-06 04:26:32
合計ジャッジ時間 3,933 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
41,324 KB
testcase_01 AC 122 ms
41,596 KB
testcase_02 AC 124 ms
41,176 KB
testcase_03 AC 114 ms
40,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class test {

  public static void main(String[] args){

    Scanner userInput = new Scanner(System.in);
    int maxCount = userInput.nextInt();
    
    userInput.close();
    for(int count = 1; count<=maxCount;count++){

      if(count%3==0 && count%5==0){
        System.out.println("FizzBuzz");
      }else if(count%3==0){
        System.out.println("Fizz");
      }else if(count%5==0){
        System.out.println("Buzz");
      }else{
        System.out.println(count);
      }
    }
  }
}
0