結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー mits58mits58
提出日時 2015-07-18 01:11:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 430 bytes
コンパイル時間 1,991 ms
コンパイル使用メモリ 71,968 KB
実行使用メモリ 56,032 KB
最終ジャッジ日時 2023-09-22 18:48:33
合計ジャッジ時間 2,909 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,948 KB
testcase_01 AC 126 ms
55,804 KB
testcase_02 AC 127 ms
56,032 KB
testcase_03 AC 131 ms
55,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
        	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