結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー fal_rndfal_rnd
提出日時 2017-03-31 22:32:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 2,317 ms
コンパイル使用メモリ 72,004 KB
実行使用メモリ 56,112 KB
最終ジャッジ日時 2023-09-21 10:54:37
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,036 KB
testcase_01 AC 115 ms
56,044 KB
testcase_02 AC 118 ms
55,736 KB
testcase_03 AC 122 ms
56,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		int in=s.nextInt(),
				one=in/in,
				zero=one-one,
				three=one+one+one,
				five=three+one+one;

		for(int i=one; i<=in; i++){
			String o = String.valueOf(i);
			if(i%three==zero){
				System.out.print("Fizz");
				o = "";
			}
			if(i%five==zero){
				System.out.print("Buzz");
				o = "";
			}
			System.out.println(o);
		}
	}
}
0