Add first project euler problem
This commit is contained in:
parent
b1cb4a0a0e
commit
dcfb3147ba
30
project_euler/problem_1.qbl
Normal file
30
project_euler/problem_1.qbl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import "../std.qbl"
|
||||||
|
|
||||||
|
true 3 0
|
||||||
|
while
|
||||||
|
{
|
||||||
|
// i sum
|
||||||
|
dup check req req +
|
||||||
|
incAndCheck req
|
||||||
|
}
|
||||||
|
|
||||||
|
deq intToStr println
|
||||||
|
|
||||||
|
function int => int check
|
||||||
|
{
|
||||||
|
3 dup % 0 req != req
|
||||||
|
// not_divisible start
|
||||||
|
if
|
||||||
|
{
|
||||||
|
5 dup % 0 req != req
|
||||||
|
if
|
||||||
|
{
|
||||||
|
deq 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function int => bool int incAndCheck
|
||||||
|
{
|
||||||
|
1 + 1000 dup < req
|
||||||
|
}
|
Reference in New Issue
Block a user