Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Loops-While/ATS/loops-while-1.ats
Normal file
20
Task/Loops-While/ATS/loops-while-1.ats
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include "share/atspre_staload.hats"
|
||||
|
||||
fn
|
||||
loop_while () : void =
|
||||
let
|
||||
fun
|
||||
loop {n : int | 0 <= n} .<n>.
|
||||
(n : uint n) : void =
|
||||
if n <> 0U then
|
||||
begin
|
||||
println! (n);
|
||||
loop (n / 2U)
|
||||
end
|
||||
in
|
||||
loop 1024U
|
||||
end
|
||||
|
||||
implement
|
||||
main0 () =
|
||||
loop_while ()
|
||||
17
Task/Loops-While/ATS/loops-while-2.ats
Normal file
17
Task/Loops-While/ATS/loops-while-2.ats
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "share/atspre_staload.hats"
|
||||
|
||||
fn
|
||||
loop_while () : void =
|
||||
let
|
||||
var n : uint = 1024U
|
||||
in
|
||||
while (0U < n)
|
||||
begin
|
||||
println! (n);
|
||||
n := n / 2U
|
||||
end
|
||||
end
|
||||
|
||||
implement
|
||||
main0 () =
|
||||
loop_while ()
|
||||
Loading…
Add table
Add a link
Reference in a new issue