結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー takutakutakutaku
提出日時 2020-09-16 15:11:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 532 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 71,440 KB
実行使用メモリ 55,804 KB
最終ジャッジ日時 2023-09-04 03:34:02
合計ジャッジ時間 3,205 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,520 KB
testcase_01 AC 123 ms
55,760 KB
testcase_02 AC 129 ms
55,804 KB
testcase_03 AC 128 ms
55,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
	  
	  Scanner sc = new Scanner(System.in);
	  int num = sc.nextInt();
	  
	  
	  for(int i = 1; i <= num; i++) {
	        int result = i;
	        if(result % 15 == 0) {
	            System.out.println("FizzBuzz");
	        }else if(result % 5 == 0) {
	            System.out.println("Buzz");
	        }else if(result % 3 == 0) {
	            System.out.println("Fizz");
	        }else {
	            System.out.println(i);
	        }
	  }
	  
	}
}
0