diff options
Diffstat (limited to 'archive/q/fizzbuzz/a/9/index.html')
| -rw-r--r-- | archive/q/fizzbuzz/a/9/index.html | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/archive/q/fizzbuzz/a/9/index.html b/archive/q/fizzbuzz/a/9/index.html new file mode 100644 index 0000000..3ce4362 --- /dev/null +++ b/archive/q/fizzbuzz/a/9/index.html @@ -0,0 +1,164 @@ +<!DOCTYPE html> +<html> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>問題 #1 - 回答 #9 | Albatross.PHP</title> + <link rel="stylesheet" href="../../../../assets/index.css"> + <link rel="icon" type="image/svg+xml" href="../../../../assets/favicon.svg"> + <script type="module" src="../../../../assets/index.js"></script> + </head> + <body> + <header class="container"> + <nav class="navbar"> + <a class="navbar-brand" href="../../../../index.html">Albatross.PHP</a> + </nav> + </header> + <main class="container mt-5"> + <h1 class="mb-4">問題 #1 - 回答 #9</h1> + <nav> + <ol class="breadcrumb"> + <li class="breadcrumb-item"><a href="../../../../index.html">問題一覧</a></li> + <li class="breadcrumb-item"><a href="../../index.html">FizzBuzz</a></li> + <li class="breadcrumb-item"><a href="../index.html">回答一覧</a></li> + <li class="breadcrumb-item active">#9</li> + </ol> + </nav> + + <h2>FizzBuzz</h2> + <p> + いわゆる「FizzBuzz」を実装してください。
+1から100までの数字について、その数が3の倍数なら「Fizz」、5の倍数なら「Buzz」、15の倍数なら「FizzBuzz」、それ以外ならその数そのものを出力してください。それぞれの出力は改行で区切ってください。 + </p> + <h2>回答 #9</h2> + <p> + tadsan が 2024-03-06 20:21:12 に投稿 + </p> + <h2>コード</h2> + <p> + 89 byte + </p> + <pre><code class="hljs language-php">echo implode("\n",array_map(fn($i)=>($i%3?'':'fizz').($i%5?'':'buzz')?:$i,range(1,100)));</code></pre> + <h2>実行結果</h2> + <div class="js-phper-token"> + </div> + <div class="mt-3"> + ステータス: <span class="js-aggregated-execution-status" data-answer-id="15">失敗</span> + </div> + <div class="mt-3"> + <h3>テストケース 1</h3> + <div> + ステータス: <span class="js-testcase-execution-status" data-testcase-execution-id="27">不正解</span> + </div> + <h4>標準出力</h4> + <pre><code class="js-testcase-execution-stdout hljs language-plaintext" data-testcase-execution-id="27">1 +2 +fizz +4 +buzz +fizz +7 +8 +fizz +buzz +11 +fizz +13 +14 +fizzbuzz +16 +17 +fizz +19 +buzz +fizz +22 +23 +fizz +buzz +26 +fizz +28 +29 +fizzbuzz +31 +32 +fizz +34 +buzz +fizz +37 +38 +fizz +buzz +41 +fizz +43 +44 +fizzbuzz +46 +47 +fizz +49 +buzz +fizz +52 +53 +fizz +buzz +56 +fizz +58 +59 +fizzbuzz +61 +62 +fizz +64 +buzz +fizz +67 +68 +fizz +buzz +71 +fizz +73 +74 +fizzbuzz +76 +77 +fizz +79 +buzz +fizz +82 +83 +fizz +buzz +86 +fizz +88 +89 +fizzbuzz +91 +92 +fizz +94 +buzz +fizz +97 +98 +fizz +buzz +</code></pre> + <h4>標準エラー出力</h4> + <pre><code class="js-testcase-execution-stderr hljs language-plaintext" data-testcase-execution-id="27"> +</code></pre> + </div> + <script type="module" src="../../../../assets/loading.js"></script> + </main> + <footer class="container text-center mt-5 mb-4"> + Albatross.PHP - PHPerKaigi 2024 + </footer> + </body> +</html> |
