我相信新的關聯數組和我具有低於此代碼。我想分配值prop和sumprop[prop]到一個新的數組,prop1和prop2。在這裏感謝一些幫助。 var name = new Array();
var amount = new Array();
name[0]="Peter";
amount[0]="50";
name[1]="John";
amount[1]="10";
name[
在這段時間我正在學習Haskell,但我在解決一個簡單的練習時遇到了問題。 我想寫一個簡單的關聯地圖數據結構來鍛鍊自己。 這是迄今爲止我所編寫的代碼: -- It represents a simple ordered couple in the form (key, value)
data Element a b = Element (a, b)
deriving (Show)
function get_frequencies($a)
{
$get_frequencies = array();
foreach($a as $k => $v)
{
$get_frequencies[$v]++ ; //this is the line causing the error
}
return $get_frequenc