Created
October 22, 2022 08:43
-
-
Save katsube/20dc8b99d7b17a3a94c437109473495d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// クエスト結果の一覧 | |
$questResult = [ | |
// ユーザーID, 討伐モンスター数, 獲得したゲーム内マネー | |
['u001', 5, 800], | |
['u002', 4, 1200], | |
['u003', 10, 900], | |
['u004', 1, 500], | |
['u005', 3, 2000] | |
]; | |
// 合計獲得マネーを表示 | |
echo totalMoney($questResult)."マネー\n"; // "5400マネー"と表示される | |
/** | |
* 合計獲得マネーを計算する | |
* | |
*/ | |
function totalMoney($result){ | |
// ★ここを回答する★ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment