听说
  • 听说

    October 3, 2021

    Linux/Mac 终端命令

    安装zshcat /etc/shells 正常情况下是没有bin/zsh乌谢:mintimate常用MAC终端命令命令说明cd+文件夹名进入文件夹cd+..返回上级目录cd返回到User目录ls显示当前目录的内容clear清屏

  • 听说

    September 25, 2021

    冒泡排序算法

    var arr = [6, 2, 7, 4, 8, 99, 22, 88]; for (var i = 1; i < arr.length; i++) { for (var j = arr.length - 1; j >= i; j--) { if (arr[j] < arr[j - 1]) { var temp = arr[j] arr[j] = arr[j - 1] arr[j - 1] = temp ...

  • 听说

    September 23, 2021

    【算法】遍历算法

    累加器var arr=[1,2,3,4,5];var sum=0;for(var i=0;i<arr.length;i++){sum += arr[i]}console.log(sum)<!-- 数组的平均数 -->console.log(sum / arr.length);求数组中的最大值 var arr = [7, 123, 2, 354, 321, 12, 66]; var max = 0, min = 0; min = arr[0]; max = arr[0]; for (var i = 0; i < ...

  • 听说

    September 23, 2021

    【算法】数组反向算法

    <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"> <title>Document</title></head><body><script> var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; var newArr = []; for (var i = 0; i < arr.length; i++) { ...

  • 听说

    September 15, 2021

    【算法】while算法题

    猜数游戏 var result = parseInt(Math.random() * 100) + 1, min = 1, max = 100; console.log(result); while (true) { var n = Number(prompt("请猜数字" + min + "~" + max)); if (n > result) { alert("大了"); max = n...