aboutsummaryrefslogtreecommitdiff
path: root/challenge-254/barroff/v/ch-1.v
blob: fdad0a833c2ef84258078f4ce587dbf5322f5b35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env -S v run

module main

import math

fn three_power(n int) bool {
	mut res := false
	for i in 0 .. math.sqrti(n) {
		tripple := i * i * i
		if n == tripple {
			res = true
			break
		}
		if n > tripple {
			break
		}
	}
	return res
}