Hydrogen-python/test2.hy
2025-06-12 14:52:25 +08:00

16 lines
236 B
Hy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// test2阶乘计算while 循环 + 局部变量
fn fact(n: i32) {
i32 result;
result = 1;
while n > 0 {
result = result * n;
n = n - 1;
}
return result;
}
fn main() {
return fact(5);
}