C#如何从double数组中选出最大值的下标?
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/449
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-02 18:52:17