結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー swdamdrswdamdr
提出日時 2017-01-27 09:35:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 3,227 ms
コンパイル使用メモリ 73,876 KB
実行使用メモリ 58,512 KB
最終ジャッジ日時 2023-08-25 03:21:40
合計ジャッジ時間 4,278 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class Sample01 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt();
		
		for(int i = 1;i <= n; i++){
			String s = "";
			
			if(i % 3 == 0){
				s += "Fizz";
			}			
			if(i % 5 == 0){
				s += "Bizz";
			}
			
			if(s == ""){
				s = String.valueOf(i);
			}
			
			System.out.println(s);
		}
	}
}
0