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/281/index.html | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 archive/q/fizzbuzz/a/281/index.html (limited to 'archive/q/fizzbuzz/a/281/index.html') diff --git a/archive/q/fizzbuzz/a/281/index.html b/archive/q/fizzbuzz/a/281/index.html new file mode 100644 index 0000000..fecb14d --- /dev/null +++ b/archive/q/fizzbuzz/a/281/index.html @@ -0,0 +1,68 @@ + + + + + 問題 #1 - 回答 #281 | Albatross.PHP + + + + + +
+ +
+
+

問題 #1 - 回答 #281

+ + +

FizzBuzz

+

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

+

回答 #281

+

+ notchman が 2024-03-09 14:42:16 に投稿 +

+

コード

+

+ 73 byte +

+
for($i=0;++$i<101;)echo$i%3?!($i%5)?$i:'Fizz':$i%5?'Buzz':'FizzBuzz',"
+";
+

実行結果

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

テストケース 1

+
+ ステータス: 不正解 +
+

標準出力

+

+Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in php.wasm code on line 6
+
+
+

標準エラー出力

+

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