import java.util.Arrays;
import java.util.Scanner;
public class Shuju5 {
public static void main(String[] args) {
int[] points = new int[] {18,25,7,36,13,2,89,63};
Arrays.sort(points);
System.out.print("升序排列:");
for(int i=0;i<points.length;i++) {
System.out.print(points[i] + "\t");
}int min = points[0];
int idext = 0;
for(int j=0;j<points.length;j++) {
if(points[j]<min) {
min = points[j];
idext = j+1;
}
}System.out.println("\n最低积分:"+min);
System.out.println("下标:" + idext);
}
}
第七章数组
最新推荐文章于 2021-12-08 17:01:57 发布