Дан массив D(16). Найти количество элементов массива. Ввод массива с помощью READ…DATA — Basic(Бейсик)

CLS
DIM Mass(16) AS SINGLE
I = 1
k = 2
f = -1
st = 10
PRINT "Vvodite elementi massiva cerez probel:"
10 s$ = INKEY$: IF s$ = "" THEN GOTO 10
d=ASC(s$)
SELECT CASE d
   CASE 48 TO 57:
   SELECT CASE f
   CASE 1: Mass(I) = Mass(I) + (d - 48) / st: st = st * 10: 
           LOCATE 2, k: PRINT USING "#"; d - 48: k = k + 1
   CASE ELSE: Mass(I) = Mass(I) * 10 + d - 48: 
              LOCATE 2, k: PRINT USING "#"; d - 48: k = k + 1
   END SELECT
   CASE 13: PRINT "Kolichestvo elementov: "; I:
            PRINT "Mass: ": FOR j = 1 TO I: PRINT Mass(j);: 
            NEXT: PRINT "Press Esc to EXIT..."
   CASE 32: I = I + 1: k = k + 2: f = false: st = 10
   CASE 46: f = 1: LOCATE 2, k: PRINT ".": k = k + 1
   CASE 27: STOP
   CASE ELSE: GOTO 10
END SELECT
GOTO 10

Leave a Comment