int count = 0; for (int i = 0; i < arr.length - 1; i++) { int minIndex = i; //假定最小值索引 int min = arr[i]; for (int j = i + 1; j < arr.length; j++) { if (min > arr[j]) { min = arr[j]; minIndex = j; } }
If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !