CLS
DIM a$(1000)
OPEN "f" FOR INPUT AS #1
DO WHILE NOT EOF(1)
i = i + 1
INPUT #1, a$(i)
LOOP
CLOSE #1
OPEN "g" FOR OUTPUT AS #1
FOR k = 1 TO i
FOR l = 1 TO k
PRINT #1, a$(k)
NEXT l
NEXT k
CLOSE #1
OPEN "g" FOR INPUT AS #1
i = 0
DO WHILE NOT EOF(1)
i = i + 1
INPUT #1, a$(i)
LOOP
CLOSE #1
FOR k = 1 TO i
PRINT a$(k); " ";
NEXT k
Тестирование выполнено в программе QB64 ( Скачать )