Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Scala中使用Int-list参数调用函数?_List_Scala_Function Call - Fatal编程技术网

如何在Scala中使用Int-list参数调用函数?

如何在Scala中使用Int-list参数调用函数?,list,scala,function-call,List,Scala,Function Call,我有这样一个函数签名: def countChange(money: Int, coins: List[Int]): Int = { 需要使用如下参数调用函数:money=4,coins=[1,2] 答案就在表面上: countChange(4, List(1,2)) 不要认为这是冒犯,但也许你应该读一读 我尝试了很多不同的东西,但不是出于某种原因。非常感谢。谢谢,我一直在读我的导师给我的几本书,还有一些关于谷歌的东西。

我有这样一个函数签名:

def countChange(money: Int, coins: List[Int]): Int = {
需要使用如下参数调用函数:money=4,coins=[1,2]


答案就在表面上:

countChange(4, List(1,2))

不要认为这是冒犯,但也许你应该读一读

我尝试了很多不同的东西,但不是出于某种原因。非常感谢。谢谢,我一直在读我的导师给我的几本书,还有一些关于谷歌的东西。