EKsumic's Blog

let today = new Beginning();

Click the left button to use the catalog.

OR

C#如何从double数组中选出最大值的下标?

C#如何从double数组中选出最大值的下标?


很好奇有没有直接的方式得到double数组里面最大值的下标,查了一下好像没有。


也就是说,你先max出最大值,再遍历一遍获得下标。


微软好像没提供最直接的方法,不过我有注意到即使是double类型,C#也能用linq语句了。

 

参考来源:

https://blog.csdn.net/doubworm/article/details/103662454

https://blog.csdn.net/u012206617/article/details/104903772/

This article was last edited at 2020-09-03 03:52:17

* *