Tue May 9 10:00:00 UTC 2023 inscode

上级 8abd2472
const s: string = "欢迎来到 InsCode"; const s: string = "欢迎来到 InsCode";
console.log(s); console.log(s);
console.log("i want to write by myself")
function bubbleSort(arr:any) {
var len = arr.length;
for (var i = 0; i < len; i++) {
for (var j = 0; j < len - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
var temp = arr[j + 1];
arr[j + 1] = arr[j];
arr[j] = temp;
}
}
}
return arr;
}
// 调用排序函数
var arr = [64, 34, 25, 12, 22, 11, 90];
console.log(bubbleSort(arr));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册