結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー kkkk
提出日時 2015-09-14 23:47:31
言語 PHP
(8.3.4)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 65 ms
コンパイル使用メモリ 18,468 KB
実行使用メモリ 18,896 KB
最終ジャッジ日時 2023-09-26 11:58:45
合計ジャッジ時間 721 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
18,768 KB
testcase_01 AC 16 ms
18,896 KB
testcase_02 AC 15 ms
18,860 KB
testcase_03 AC 15 ms
18,768 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    $N = trim(fgets(STDIN));
    
    for ($n=1; $n<=$N; $n++){
    	$output = "";
    	
	    if ( $n%3===0 && $n>=3 ){
	        $output .= "Fizz";
	    }
	    
	    if ( $n%5===0 && $n>=5 ){
	    	$output .= "Buzz";
	    }
	    
	    if ( $output === "" ){
	    	echo $n;	
	    }else{
	    	echo $output;
	    }
	    
	    echo "\n";
    }
0