Scripts
global
prime
power
newtonraphson
fibonacci
file
multithread
digitcubes
perfectseries
perfecttest
kapreckerNumber
kapreckerConstant
hawkresponse
entityTemplate
array
multipleAssignment
global
prime
power
newtonraphson
fibonacci
file
multithread
digitcubes
perfectseries
perfecttest
kapreckerNumber
kapreckerConstant
hawkresponse
entityTemplate
array
multipleAssignment
function main()
{
exec display(`exec testCubes()`)
}
function display( var numbers[])
{
var size = `exec length(numbers)`
for( var i = 1;i <= size; i= i+1 )
{
echo numbers[i]
}
}
function testCubes()
{
var result [] = new var[]
var i = 1
for(var x = 0;x<=9 ; x=x+1)
{
for(var y = 0;y<=9 ; y=y+1)
{
for(var z = 0;z<=9 ; z=z+1)
{
var lhs = `exec pow(x,3)` + `exec pow(y,3)` + `exec pow(z,3)`
var rhs = 100*x + 10*y +z
if(lhs == rhs)
{
result[i] = rhs
i = i +1
}
}
}
}
return result
}
{
exec display(`exec testCubes()`)
}
function display( var numbers[])
{
var size = `exec length(numbers)`
for( var i = 1;i <= size; i= i+1 )
{
echo numbers[i]
}
}
function testCubes()
{
var result [] = new var[]
var i = 1
for(var x = 0;x<=9 ; x=x+1)
{
for(var y = 0;y<=9 ; y=y+1)
{
for(var z = 0;z<=9 ; z=z+1)
{
var lhs = `exec pow(x,3)` + `exec pow(y,3)` + `exec pow(z,3)`
var rhs = 100*x + 10*y +z
if(lhs == rhs)
{
result[i] = rhs
i = i +1
}
}
}
}
return result
}
0
1
153
370
371
407
1
153
370
371
407