Jump to content

Water collected between towers: Difference between revisions

m
→‎{{header|BASIC}}: Refine implementation: GW-BASIC.
(added Arturo)
m (→‎{{header|BASIC}}: Refine implementation: GW-BASIC.)
Line 864:
 
=={{header|BASIC}}==
==={{header|GW-BASIC}}===
<syntaxhighlight lang="basic">10 DEFINT A-Z: DIM T(20): K=0
{{works with|BASICA}}
<syntaxhighlight lang="basicgwbasic">10 DEFINT A-Z: DIM T(20): K=0
20 K=K+1: READ N: IF N=0 THEN END
30 FOR I=0 TO N-1: READ T(I): NEXT
Line 884 ⟶ 886:
190 DATA 5, 6,7,10,7,6
200 DATA 0</syntaxhighlight>
 
{{out}}
 
<pre>Block 1 holds 2 water units.
Block 2 holds 14 water units.
512

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.