Generalized state

This commit is contained in:
Dmitry Boulytchev 2019-09-29 02:47:07 +03:00
parent c3e6d4c76d
commit 36685d1592
56 changed files with 64 additions and 65 deletions

View file

@ -1,3 +1,3 @@
global x = read (), y = read (), z = x * y * 3;
local x = read (), y = read (), z = x * y * 3;
write (z)

View file

@ -1,4 +1,4 @@
global x, y, z;
local x, y, z;
x := read ();
y := read ();

View file

@ -1,4 +1,4 @@
global x, y;
local x, y;
x := read ();
y := read ();

View file

@ -1,4 +1,4 @@
global x, y, z;
local x, y, z;
x := read ();
y := read ();

View file

@ -1,4 +1,4 @@
global x, y, z;
local x, y, z;
x := read ();
y := read ();

View file

@ -1,4 +1,4 @@
global x, y, z;
local x, y, z;
x := read ();
y := read ();

View file

@ -1,4 +1,4 @@
global x, y, z;
local x, y, z;
x := 1;
y := 2;

View file

@ -1,4 +1,4 @@
global z;
local z;
z := 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9;
write (z)

View file

@ -1,4 +1,4 @@
global n = 2, k = 10;
local n = 2, k = 10;
{local res = 1;
while k > 0 do

View file

@ -1,4 +1,4 @@
global i, s;
local i, s;
i := 0;
s := 0;

View file

@ -1,4 +1,4 @@
global x;
local x;
x:=0;
if x

View file

@ -1,4 +1,4 @@
global n;
local n;
n := read ();
while n >= 0 do

View file

@ -1,4 +1,4 @@
global n = read ();
local n = read ();
repeat

View file

@ -1,4 +1,4 @@
global n;
local n;
n := read ();

View file

@ -1,4 +1,4 @@
global s, n, p;
local s, n, p;
s := 0;
n := read ();

View file

@ -1,4 +1,4 @@
global s, n;
local s, n;
n := read ();

View file

@ -1,4 +1,4 @@
global n, fib_1, fib_2, fib, i;
local n, fib_1, fib_2, fib, i;
n := read ();

View file

@ -1,4 +1,4 @@
global n, c, p, q, i, m, d;
local n, c, p, q, i, m, d;
n := read ();

View file

@ -1,4 +1,4 @@
global i, s;
local i, s;
i := 0;
s := 0;

View file

@ -1,4 +1,4 @@
global s, n, p;
local s, n, p;
s := 0;
n := read ();

View file

@ -1,4 +1,4 @@
global n, f;
local n, f;
n := read ();
f := 1;

View file

@ -1,4 +1,4 @@
global n, fib_1, fib_2, fib, i;
local n, fib_1, fib_2, fib, i;
n := read ();

View file

@ -1,4 +1,4 @@
global s, n;
local s, n;
s := 0;

View file

@ -6,7 +6,7 @@ fun test2 (b) {
a := b
}
global x, a, b;
local x, a, b;
x := read ();

View file

@ -1,4 +1,4 @@
global x, a, b, c;
local x, a, b, c;
fun test1 (a) {
write (a)

View file

@ -1,4 +1,4 @@
global x, a, b, c;
local x, a, b, c;
fun test1 (a) {
write (a);

View file

@ -1,4 +1,4 @@
global x, a, b, c;
local x, a, b, c;
fun print () {
write (a);

View file

@ -1,4 +1,4 @@
global n, i, result;
local n, i, result;
fun fact (n) {
if n <= 1

View file

@ -1,4 +1,4 @@
global i, n, result;
local i, n, result;
fun fib (n) {
local r;

View file

@ -1,4 +1,4 @@
global n, i;
local n, i;
fun fib (n) {
if n <= 1

View file

@ -1,4 +1,4 @@
global n, i;
local n, i;
fun fact (n) {
if n <= 1

View file

@ -1,4 +1,4 @@
global x, m, n;
local x, m, n;
fun ack (m, n) {
if m == 0 then return (n+1)

View file

@ -1,4 +1,4 @@
global x;
local x;
fun test (n, m) {
local i, s;

View file

@ -1,4 +1,4 @@
global n, x, i;
local n, x, i;
fun printString (x) {
for i:=0, i<x.length, i:=i+1 do

View file

@ -1,4 +1,4 @@
global n, x, i;
local n, x, i;
fun printArray (x) {
local elem;

View file

@ -1,4 +1,4 @@
global x, y, i, j;
local x, y, i, j;
fun printAS (x) {
local i, j;

View file

@ -1,4 +1,4 @@
global n, x, i;
local n, x, i;
fun sort (x) {
local i, j, y, n;

View file

@ -1,4 +1,4 @@
global n, x, y;
local n, x, y;
fun append (x, y) {
case x of

View file

@ -1,4 +1,4 @@
global n, t;
local n, t;
fun insert (t, x) {
case t of

View file

@ -1,4 +1,4 @@
global x;
local x;
fun f (x) {
case x of

View file

@ -1,4 +1,4 @@
global x;
local x;
fun f (a) {
case a of

View file

@ -1,4 +1,4 @@
global x, y, i;
local x, y, i;
fun f (x) {
case x of

View file

@ -1,4 +1,4 @@
global x;
local x;
fun sum (x) {
case x of

View file

@ -1,4 +1,4 @@
global x, y, z;
local x, y, z;
fun zip (x) {
case x of Pair (x, y) ->

View file

@ -1,4 +1,4 @@
global x;
local x;
fun printString (s) {
local i;

View file

@ -1,4 +1,4 @@
global n;
local n;
n := read ();

View file

@ -1,4 +1,4 @@
global n;
local n;
fun collect_ints_acc (v, tail) {
local i;

View file

@ -1,4 +1,4 @@
global n, y;
local n, y;
fun test (n, m) {
local i, s;

View file

@ -1,4 +1,4 @@
global n, y, y2, t;
local n, y, y2, t;
fun test (n, m) {
local i, s;

View file

@ -1,4 +1,4 @@
global n, x, y;
local n, x, y;
n := read ();
x := [1];

View file

@ -1,4 +1,4 @@
global n;
local n;
fun sum (l) {
case l of

View file

@ -1,4 +1,4 @@
global n;
local n;
fun hd (l) {
case l of

View file

@ -1,4 +1,4 @@
global n;
local n;
infix "===" at "==" (v1, v2) {
local s1, s2, i;

View file

@ -1,4 +1,4 @@
global x, y, z, s, i, n;
local x, y, z, s, i, n;
x := y := z := 105;