示例页面

来自三三百科
33DAI留言 | 贡献2026年1月30日 (五) 04:11的版本 (创建页面,内容为“== 代码片段 == <syntaxhighlight lang="python" line> def hello_world(): print("Hello World!") </syntaxhighlight> <syntaxhighlight lang="cpp" line highlight="5"> #include <bits/stdc++.h> using namespace std; int main() { cout << "Hello World!"; return 0; } </syntaxhighlight> * lang: 指定语言(如 php, python, javascript, cpp, html, css 等)。 * line: 开启行号显示。 * start: 指定起始行号(例如 start="50")。 * highlight…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到导航 跳转到搜索

代码片段

def hello_world():
    print("Hello World!")
#include <bits/stdc++.h>
using namespace std;
int main()
{
    cout << "Hello World!";
    return 0;
}
  • lang: 指定语言(如 php, python, javascript, cpp, html, css 等)。
  • line: 开启行号显示。
  • start: 指定起始行号(例如 start="50")。
  • highlight: 高亮特定行(例如 highlight="3-5")。
  • inline: 在行内显示高亮代码(适合在段落中插入短代码)。

数学公式

[math]\displaystyle{ E=mc^2 }[/math]

[math]\displaystyle{ \sum_{i=1}^n i = \frac{n(n+1)}{2} }[/math]