結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー MatumoMatumo
提出日時 2018-07-13 02:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 150 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 2,616 ms
コンパイル使用メモリ 75,176 KB
実行使用メモリ 54,504 KB
最終ジャッジ日時 2024-04-15 08:14:08
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
54,160 KB
testcase_01 AC 145 ms
53,984 KB
testcase_02 AC 146 ms
54,124 KB
testcase_03 AC 150 ms
54,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

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

	public static void main(String[] args) {
		int n = sc.nextInt();
		
		for(int i = 1; i <= n; i++) {
			if(i % 3 == 0) System.out.print("Fizz");
			if(i % 5 == 0) System.out.print("Buzz");
			if(i % 3 != 0 && i % 5 != 0) System.out.print(i);
			System.out.println();
		}
		
    }
}
0