small fixes
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
func num_divisors[n: I64] : I64
|
||||
let end: I64 = Math.isqrt(n)
|
||||
|
||||
let result: I64 = 0
|
||||
let out: I64 = 0
|
||||
for i in 1..end+1
|
||||
if n % i == 0
|
||||
result = result + 2
|
||||
out = out + 2
|
||||
|
||||
if end * end == n
|
||||
result = result - 1
|
||||
return result
|
||||
out = out - 1
|
||||
return out
|
||||
|
||||
func main[] : I64
|
||||
let n: I64 = 0
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
func quicksort[arr: Array] : I64
|
||||
do_quicksort(arr, 0, Array.size(arr)-1)
|
||||
return 0
|
||||
|
||||
func do_quicksort[arr: Array, low: I64, high: I64] : I64
|
||||
if low < high
|
||||
let i: I64 = partition(arr, low, high)
|
||||
do_quicksort(arr, low, i - 1)
|
||||
do_quicksort(arr, i + 1, high)
|
||||
return 0
|
||||
|
||||
func partition[arr: Array, low: I64, high: I64] : I64
|
||||
let pivot: I64 = Array.nth(arr, high)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
func main[] : I64
|
||||
let a: String = I64.to_string(58394)
|
||||
print_i64(strlen(a))
|
||||
let b: String = String.concat(a, "test")
|
||||
print_i64(strlen(b))
|
||||
free(a)
|
||||
free(b)
|
||||
Reference in New Issue
Block a user