教大家如何引用代码块
2026-08-01 18:04:46
发布于:河北
用三个`(类似python的格式去围上代码)
格式:
```编程语言
代码
```c(把c去掉)
例如:
#python:
print("a")
//c++,要填cpp!
#include <iostream>
using namespace std;
int main(){
return 0;
}
//JavaScript
function solveRandomNumbers(arr) {
// 去重
let unique = [...new Set(arr)];
// 排序(从小到大)
unique.sort((a, b) => a - b);
return unique;
}
// 测试数据
let input = [20, 40, 32, 67, 40, 20, 89, 300, 400, 15];
let result = solveRandomNumbers(input);
console.log(result.length);
console.log(result.join(" "));
<!-- html,嵌入css和JavaScript -->
<!DOCTYPE html>
<html>
<head>
<style>
.box { color: red; }
</style>
</head>
<body>
<div class="box">测试</div>
<script>
console.log("Hello");
</script>
</body>
</html>
REM 命令行
echo Hello World
希望能帮助更多人写编程帖子
全部评论 1
cmd2026-08-01 来自 河北
0



















有帮助,赞一个