• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1FUN max(a, b) = IF a > b THEN a ELSE b FI
2
3-- n anzahl schleifendurchlaeufe
4-- m bisheriges maximum
5FUN LOOP(n, m) = IF n > 0 THEN
6		 LET
7			x = READ()
8		 IN
9			LOOP(n - 1, max(m, x))
10		 ELSE
11			m
12		 FI
13
14FUN abs(n) = IF n > 0 THEN n ELSE -n FI
15
16FUN main() =
17	LET a = READ()
18--	    b = READ()
19	IN
20	    --WRITE(max(a, b))
21	    WRITE(LOOP(abs(a), -47110815))
22