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

19 lines
281 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.

/*test1斐波那契数列控制流 + 函数调用*/
fn fib(n:i32) -> i32 {
if n < 1 {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}
}
fn main() {
i32 x;
i32 y;
x = 5 * 2 + 2;
a = 2 == 2;
x = fib(6);
return x;
}