14 lines
296 B
Text
14 lines
296 B
Text
n = 0
|
|
sum = 0
|
|
|
|
while True
|
|
input "Enter integral rainfall (99999 to quit): ", i
|
|
if i = 99999 then exit while
|
|
if (i < 0) or (i <> int(i)) then
|
|
print "Must be an integer no less than 0, try again."
|
|
else
|
|
n += 1
|
|
sum += i
|
|
print " The current average rainfall is "; sum/n
|
|
end if
|
|
end while
|