mirror of
https://github.com/vishapoberon/oberonbyexample.git
synced 2026-04-05 21:02:25 +00:00
changed tabs with spaces
This commit is contained in:
parent
e49b38df73
commit
d110fb0ac8
12 changed files with 132 additions and 119 deletions
|
|
@ -28,6 +28,13 @@ BEGIN
|
||||||
Out.Int(n,0); Out.String(" is even"); Out.Ln;
|
Out.Int(n,0); Out.String(" is even"); Out.Ln;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
IF ~ODD(m)
|
||||||
|
THEN
|
||||||
|
Out.Int(m,0); Out.String(" is even"); Out.Ln;
|
||||||
|
ELSE
|
||||||
|
Out.Int(m,0); Out.String(" is odd"); Out.Ln;
|
||||||
|
END;
|
||||||
|
|
||||||
n := 9;
|
n := 9;
|
||||||
|
|
||||||
IF n < 0
|
IF n < 0
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,16 @@ MODULE square;
|
||||||
|
|
||||||
IMPORT Out;
|
IMPORT Out;
|
||||||
|
|
||||||
|
|
||||||
VAR s : INTEGER;
|
VAR s : INTEGER;
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE squared(x : INTEGER): INTEGER;
|
PROCEDURE squared(x : INTEGER): INTEGER;
|
||||||
BEGIN
|
BEGIN
|
||||||
RETURN x * x
|
RETURN x * x
|
||||||
END squared;
|
END squared;
|
||||||
|
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
s := squared(7);
|
s := squared(7);
|
||||||
Out.Int(s, 0); Out.Ln;
|
Out.Int(s, 0); Out.Ln;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ MODULE proc;
|
||||||
|
|
||||||
IMPORT Out;
|
IMPORT Out;
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE printSum(a, b : INTEGER);
|
PROCEDURE printSum(a, b : INTEGER);
|
||||||
BEGIN
|
BEGIN
|
||||||
Out.Int(a + b, 0); Out.Ln
|
Out.Int(a + b, 0); Out.Ln
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
MODULE varparam;
|
MODULE varparam;
|
||||||
|
|
||||||
|
|
||||||
IMPORT Out;
|
IMPORT Out;
|
||||||
|
|
||||||
VAR
|
|
||||||
a, b : INTEGER;
|
VAR a, b : INTEGER;
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE swapVals(VAR x, y : INTEGER);
|
PROCEDURE swapVals(VAR x, y : INTEGER);
|
||||||
VAR tmp : INTEGER;
|
VAR tmp : INTEGER;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue