結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー Ruizi_Luigi
提出日時 2015-07-24 10:50:33
言語 PHP
(8.5.4)
コンパイル:
php -l _filename_
実行:
php _filename_
結果
WA  
実行時間 -
コード長 262 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 82 ms
コンパイル使用メモリ 38,136 KB
実行使用メモリ 38,296 KB
最終ジャッジ日時 2026-03-30 06:47:17
合計ジャッジ時間 606 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
PHP Deprecated:  Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 4

Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 4
No syntax errors detected in Main.php

ソースコード

diff #
raw source code

<?php
    $n = trim(fgets(STDIN));
    
    for ($i = 1; $i <= (integer)$n; $i++) {
    	if ($i > 1) echo "<br>";
    	$tmp = "";
    	if ($i%3 === 0) $tmp .= "Fizz";
    	if ($i%5 === 0) $tmp .= "Buzz";
    	echo (strlen($tmp) > 0 ? $tmp : (string)$i);
    }
?>
0