結果
問題 | No.9002 FizzBuzz(テスト用) |
ユーザー | Gchansanjou |
提出日時 | 2018-02-09 01:49:49 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 48 ms / 5,000 ms |
コード長 | 743 bytes |
コンパイル時間 | 2,673 ms |
コンパイル使用メモリ | 74,720 KB |
実行使用メモリ | 50,404 KB |
最終ジャッジ日時 | 2024-04-09 20:52:26 |
合計ジャッジ時間 | 3,337 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 45 ms
50,020 KB |
testcase_01 | AC | 45 ms
50,404 KB |
testcase_02 | AC | 46 ms
50,348 KB |
testcase_03 | AC | 48 ms
50,036 KB |
ソースコード
package yukiCoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No09002 { public static void main(String[] args) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); try { int input = Integer.parseInt(bufferedReader.readLine()); for (int i = 1 ; i <= input ; i++) { if (0 == i%3 && 0 == i%5) { System.out.println("FizzBuzz"); } else if (0 == i%3) { System.out.println("Fizz"); } else if (0 == i%5) { System.out.println("Buzz"); } else { System.out.println(i); } } } catch (NumberFormatException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }