/*
Add all the natural numbers below one thousand that are multiples of 3 or 5.
*-
object p1 {
def main(args: Array[String]) {
var i = 0
var sum = 0
while( i < 1000 ) {
if( i % 3 == 0 || i % 5 == 0 ) sum += i
i += 1
}
println("p1's result ::" + sum )
}
}
개인 감상 :: 전혀 스칼라 스럽지 않다 -_-
Add all the natural numbers below one thousand that are multiples of 3 or 5.
*-
object p1 {
def main(args: Array[String]) {
var i = 0
var sum = 0
while( i < 1000 ) {
if( i % 3 == 0 || i % 5 == 0 ) sum += i
i += 1
}
println("p1's result ::" + sum )
}
}
개인 감상 :: 전혀 스칼라 스럽지 않다 -_-
최근 덧글