import java.util.Scanner; public class FizzBuzz { public static void main(String[] args) { // 標準入力から読み込む際に、Scannerオブジェクトを使う。 Scanner sc = new Scanner(System.in); // int 1つ分を読み込む int number = sc.nextInt(); //System.out.println(judgeFizzBuzz(number)); for (int i = 1; i <= number; i++ ) { System.out.println(judgeFizzBuzz(i)); } } private static String judgeFizzBuzz(int number) { if (number % 3 == 0 && number % 5 == 0) { return "FizzBuzz"; } if (number % 3 == 0) { return"Fizz"; } if (number% 5 == 0) { return"Buzz"; } return String.valueOf(number); } }