support up to 6 args, euler

This commit is contained in:
2025-06-01 16:12:47 +02:00
parent 7fa08d8b37
commit 8a0fbac739
12 changed files with 213 additions and 24 deletions

21
examples/euler5.zr Normal file
View File

@@ -0,0 +1,21 @@
func print_i64[x : I64] : I64
printf("%ld\n", x)
func gcd[a: I64, b: I64] : I64
while b != 0
let tmp: I64 = b
b = a % b
a = tmp
return a
func lcm[a: I64, b: I64] : I64
return (a * b) / gcd(a, b)
func main[] : I64
let out: I64 = 1
let i: I64 = 1
while i < 21
out = lcm(out, i)
i = i + 1
print_i64(out)