Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个数组:其中一个是二维数组
A = Array.ofDim[Double](2,4) //A={(1.0,2.0,3.0,4.0),(5.0,6.0,7.0,8.0)} B = new Array[Int](2) //B=(1,2)
如何将它们组合在这种输出中?
(1 ,1.0,2.0,3.0,4.0),(2 ,5.0,6.0,7.0,8.0)}
我尝试了,**++** ****+:*** ***:+***但我可以做到。可能吗??
**++** ****+:*** ***:+***
尝试这个:
(A, B).zipped.map { case (a, b) => b.toDouble +: a }