euler/v/euler006.v

10 lines
221 B
Coq
Raw Normal View History

2020-01-08 20:51:45 +00:00
import euler
fn main() {
range := euler.range(1, 100)
sum := range.reduce(euler.add, 0)
square_of_sum := sum * sum
sum_of_squares := range.map(it * it).reduce(euler.add, 0)
println(square_of_sum - sum_of_squares)
}