mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
17 lines
212 B
Text
17 lines
212 B
Text
|
|
local x;
|
||
|
|
|
||
|
|
fun test (n, m) {
|
||
|
|
local i, s;
|
||
|
|
s := 0;
|
||
|
|
for i := 0, i <= n, i := i + 1 do
|
||
|
|
s := s + i;
|
||
|
|
if s > m then return s fi
|
||
|
|
od;
|
||
|
|
|
||
|
|
s
|
||
|
|
}
|
||
|
|
|
||
|
|
x := read ();
|
||
|
|
|
||
|
|
write (test (10, 100));
|
||
|
|
write (test (100, 10))
|