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.
我有我认为非常愚蠢的问题,但是我可以将二维数组中的一条线与另一条线“卡住”吗?我的意思是我想按一行对数组进行排序,但我希望另一行也改变。
我有一个数组,其中一行是容器的 ID,另一行是容器的重量。它看起来有点像这样:
[1,2,3,4,5] [3.2,2.3,6.5,9.3,5.6]
当我对第二行(重量)进行排序时,上部不会改变,我也希望它改变,因为它是容器的 id,重量也连接到这个容器。