OPEN "input.txt" FOR INPUT AS #1
INPUT #1,n
DIM a(n)
FOR i=1 TO n
INPUT #1,a(i)
NEXT
CLOSE
FOR i=1 TO n
s=s+a(i)
NEXT
OPEN"output.txt"FOR OUTPUT AS #2
PRINT #2,s
CLOSE
OPEN "input.txt" FOR INPUT AS #1
INPUT #1,n
DIM a(n)
FOR i=1 TO n
INPUT #1,a(i)
NEXT
CLOSE
FOR i=1 TO n
s=s+a(i)
NEXT
OPEN"output.txt"FOR OUTPUT AS #2
PRINT #2,s
CLOSE