結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー ぴろず
提出日時 2017-03-31 23:15:34
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 1,751 ms
コンパイル使用メモリ 75,016 KB
実行使用メモリ 53,916 KB
最終ジャッジ日時 2024-07-07 05:24:15
合計ジャッジ時間 2,773 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static int ZERO = "".length();
	public static int ONE = "A".length();
	public static int THREE = "AAA".length();
	public static int FIVE = "AAAAA".length();
	public static int FIFTEEN = THREE * FIVE;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i=ONE;i<=n;i++) {
			if (n % FIFTEEN == ZERO) {
				System.out.println("FizzBuzz");
			}else if(n % THREE == ZERO) {
				System.out.println("Fizz");
			}else if(n % FIVE == ZERO) {
				System.out.println("Buzz");
			}else{
				System.out.println(i);
			}
		}
	}

}
0