Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit a555972

Browse files
committed
新增简单时间测试程序,计算0到1000的和并输出结果。
1 parent 59e752e commit a555972

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/time_test.cn

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using lib <io>;
2+
using ns std;
3+
4+
// 简单的时间测试程序
5+
fn main() : int {
6+
std::println("时间测试程序");
7+
8+
// 简单计算
9+
sum : int = 0;
10+
for (i : 0..1000) {
11+
sum = sum + i;
12+
};
13+
14+
std::println("计算结果: " + sum);
15+
return 0;
16+
};

0 commit comments

Comments
 (0)