Welcome Research Lab

Sat Mar 28 2026 00:00:00 GMT+0000 (Coordinated Universal Time)

可复现实验示例

本文演示:读者可以在文章中直接运行代码,不必跳转外部平台。

Python 片段(可运行)

python
n = int(input())
print(n * (n + 1) // 2)
点击运行后显示输出

C 片段(可运行)

c
#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  printf("%d\\n", n * (n + 1) / 2);
  return 0;
}
点击运行后显示输出

数学公式

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}

复现实验记录

相关运行记录(可筛选语言)

打开 Lab

暂无可展示运行记录。

讨论

评论系统尚未配置。请在环境变量中设置 Giscus 参数后启用评论功能。