結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー jshimazu0820jshimazu0820
提出日時 2014-11-23 14:04:37
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 249 bytes
コンパイル時間 1,226 ms
コンパイル使用メモリ 18,580 KB
実行使用メモリ 18,928 KB
最終ジャッジ日時 2023-08-30 22:14:33
合計ジャッジ時間 1,592 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php
$N  = trim(fgets(STDIN));

for ($i = 1; $i <= $N; $i++ ) {
  $str = '';

  if ($i % 3 == 0) {
    $str .= "Fizz";
  }

  if ($i % 5 == 0) {
    $str .= "Buzz";
  }

  if (!$str) {
    $str .= $i;
  }

  echo $str . "\n";
}
0