結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー Enter_0620Enter_0620
提出日時 2016-03-31 19:53:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 459 bytes
コンパイル時間 1,950 ms
コンパイル使用メモリ 74,380 KB
実行使用メモリ 54,104 KB
最終ジャッジ日時 2024-04-10 06:53:01
合計ジャッジ時間 3,019 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
53,112 KB
testcase_01 AC 124 ms
54,104 KB
testcase_02 AC 126 ms
54,060 KB
testcase_03 AC 131 ms
53,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class yuki9002
{
	public static void main ( String[] args ) {
		Scanner sc = new Scanner ( System.in );

		int num = sc.nextInt ();

		for ( int i = 1; i <= num; i++ ) {
			if ( i % 3 == 0 && i % 5 == 0 ) {
				System.out.println ( "FizzBuzz" );
			} else if ( i % 3 == 0 ) {
				System.out.println ( "Fizz" );
			} else if ( i % 5 == 0 ) {
				System.out.println ( "Buzz" );
			} else {
				System.out.println ( i );
			}
		}
	}
}
0