mirror of
https://codeberg.org/ProgramSnail/truffle-lama.git
synced 2026-01-07 20:25:03 +00:00
add (copy) regression lama tests
This commit is contained in:
parent
91505d247b
commit
30a0b63ba5
240 changed files with 1904 additions and 0 deletions
22
src/test/lama/test020.lama
Normal file
22
src/test/lama/test020.lama
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
var s, n, p;
|
||||
|
||||
s := 0;
|
||||
n := read ();
|
||||
p := 2;
|
||||
|
||||
while n > 0 do
|
||||
var c = 2;
|
||||
var f = 1;
|
||||
|
||||
for c := 2, c*c <= p && f, c := c+1
|
||||
do
|
||||
f := p % c != 0
|
||||
od;
|
||||
|
||||
if f != 0 then
|
||||
if n == 1 then write (p) fi;
|
||||
n := n - 1
|
||||
fi;
|
||||
|
||||
p := p + 1
|
||||
od
|
||||
Loading…
Add table
Add a link
Reference in a new issue