From fbd4f2129ce8fe106391302896dd86e05b2f331b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 5 Dec 2025 04:08:22 +0900 Subject: add files --- archive/q/fizzbuzz/a/30/index.html | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 archive/q/fizzbuzz/a/30/index.html (limited to 'archive/q/fizzbuzz/a/30/index.html') diff --git a/archive/q/fizzbuzz/a/30/index.html b/archive/q/fizzbuzz/a/30/index.html new file mode 100644 index 0000000..84f6676 --- /dev/null +++ b/archive/q/fizzbuzz/a/30/index.html @@ -0,0 +1,67 @@ + + + + + 問題 #1 - 回答 #30 | Albatross.PHP + + + + + +
+ +
+
+

問題 #1 - 回答 #30

+ + +

FizzBuzz

+

+ いわゆる「FizzBuzz」を実装してください。 +1から100までの数字について、その数が3の倍数なら「Fizz」、5の倍数なら「Buzz」、15の倍数なら「FizzBuzz」、それ以外ならその数そのものを出力してください。それぞれの出力は改行で区切ってください。 +

+

回答 #30

+

+ gennei が 2024-03-07 22:25:31 に投稿 +

+

コード

+

+ 149 byte +

+
foreach(range(1,100)as$i){echomatch([$i%3===0,$i%5===0]){[true,true]=>"FizzBuzz",[true,false]=>"Fizz",[false,true]=>"Buzz",[false,false]=>$i,},"\n";}
+

実行結果

+
+
+
+ ステータス: 失敗 +
+
+

テストケース 1

+
+ ステータス: 実行時エラー +
+

標準出力

+

+Parse error: syntax error, unexpected token "=>" in php.wasm code on line 6
+
+
+

標準エラー出力

+

+
+
+ +
+ + + -- cgit v1.2.3-70-g09d2