Skip to content

Instantly share code, notes, and snippets.

@katsube
Created October 22, 2022 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katsube/20dc8b99d7b17a3a94c437109473495d to your computer and use it in GitHub Desktop.
Save katsube/20dc8b99d7b17a3a94c437109473495d to your computer and use it in GitHub Desktop.
<?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