'Microsoft QBASIC 1.0
DATA 23.45,51.8,-6.3,18,-11.9,37.2,-4,19,31.4,-11.2
DIM m(1 TO 10) AS DOUBLE
CLS
k = 0
FOR i = 1 TO 10
READ m(i)
PRINT m(i); ' ';
IF m(i) > 0 THEN k = k + 1
NEXT i
PRINT
REDIM n(1 TO k)
j = 0
FOR i = 1 TO 10
IF m(i) > 0 THEN
j = j + 1
n(j) = SQR(m(i))
PRINT n(j); ' '
END IF
NEXT i
PRINT
Тестовое решение
23.45 51.8 -6.3 18 -11.9 37.2 -4 19 31.4 -11.2
4.84252 7.197222 4.24264 6.09918 4.358899 5.60357