ZIP23552679郭磊.zip 8.25KB

wzy050322

资源文件列表:

23552679郭磊.zip 大约有19个文件
  1. 23552679郭磊/selection/
  2. 23552679郭磊/selection/.idea/
  3. 23552679郭磊/selection/.idea/encodings.xml 205B
  4. 23552679郭磊/selection/.idea/misc.xml 276B
  5. 23552679郭磊/selection/.idea/modules.xml 265B
  6. 23552679郭磊/selection/.idea/workspace.xml 14.62KB
  7. 23552679郭磊/selection/out/
  8. 23552679郭磊/selection/out/production/
  9. 23552679郭磊/selection/out/production/selection/
  10. 23552679郭磊/selection/out/production/selection/cn/
  11. 23552679郭磊/selection/out/production/selection/cn/edu/
  12. 23552679郭磊/selection/out/production/selection/cn/edu/aynu/
  13. 23552679郭磊/selection/out/production/selection/cn/edu/aynu/SelectionSort.class 1.74KB
  14. 23552679郭磊/selection/selection.iml 433B
  15. 23552679郭磊/selection/src/
  16. 23552679郭磊/selection/src/cn/
  17. 23552679郭磊/selection/src/cn/edu/
  18. 23552679郭磊/selection/src/cn/edu/aynu/
  19. 23552679郭磊/selection/src/cn/edu/aynu/SelectionSort.java 1.8KB

资源介绍:

23552679郭磊.zip
package cn.edu.aynu; import java.util.Scanner; /** * company: www.abc.com * Author: Administrator * Create Data: 2024/9/11 0011 */ public class SelectionSort { public static void main(String[] args) { // 1 定义一个整型数组 int[] arr = new int[5]; // 2 通过键盘让用户随机输入5个整数,并赋值给数组 System.out.println("请输入5个整数:"); arrayInput(arr); // 3 输出原始数组 -- 排序前 System.out.println("排序前:"); printArray(arr); // 4 选择法排序 selectionSort(arr); // 5 输出排序结果 -- 排序后 System.out.println("排序后:"); printArray(arr); } // 定义一个为数组赋值的方法 private static void arrayInput(int[] arr) { Scanner sc = new Scanner(System.in); for (int i = 0; i < arr.length; i++) { arr[i] = sc.nextInt(); } } // 定义一个选择法排序(由小到到排序)的方法 private static void selectionSort(int[] arr) { for (int i = 0; i < arr.length; i++) { int index = i; // 在一轮中查找最小数的下标 for (int j = i + 1; j < arr.length; j++) { if (arr[index] > arr[j]) { index = j; } } // 交换 if (index != i) { int tmp = arr[index]; arr[index] = arr[i]; arr[i] = tmp; } } } // 定义一个输出数组的方法 private static void printArray(int[] arr) { for (int i = 0; i < arr.length; i++) { System.out.println("arr[" + i + "] = " + arr[i]); } } }
100+评论
captcha
    类型标题大小时间
    ZIPpython封装的ALSA库源码及示例40.88KB7月前
    ZIPMATLAB代码:综合能源系统优化模型概述及其鲁棒优化主要内容: 本文在分析典型冷热电联供(combined cooling429.6KB7月前
    ZIP雅马哈机械手程序程序里有跟相机Socket通信数据处理,此流程为锁螺丝,对每个螺丝位置进行拿照定位补偿,托盘定义里也设计到,942.41KB7月前
    ZIP含光伏的储能选址定容模型 14节点程序采用改进粒子群算法,对分析14节点配网系统中的储能选址定容方案,并得到储能的出力情况,有175.02KB7月前
    ZIPreport ETL .ffff98.71MB7月前
    ZIP西门子s7 200smart与3台欧姆龙E5cc温控器通讯控 功能:可以直接应用现场 实现西门子s7 200smart对3台欧姆6.86MB7月前
    ZIP《图书管理系统》JavaSE:循环、判断27.31KB7月前
    ZIP分布式电源优化配置 二阶锥编程方法:采用matlab+yalmip编程,cplex或gurobi作为求解器 主要内容:考虑配411.83KB7月前