24 lines
534 B
Plaintext
24 lines
534 B
Plaintext
100 cls
|
|
110 dim x$(2)
|
|
120 i = 0 ' índice de cadena de entrada
|
|
130 x$(i) = "1"
|
|
140 input "Indica cuantas repeticiones: ",r
|
|
150 print "Secuencia:"
|
|
160 print x$(i)
|
|
170 for n = 1 to r-1
|
|
180 j = 1-i ' índice de cadena de salida
|
|
190 x$(j) = ""
|
|
200 k = 1
|
|
210 while k <= len(x$(i))
|
|
220 k0 = k+1
|
|
230 while ((k0 <= len(x$(i))) and (mid$(x$(i),k,1) = mid$(x$(i),k0,1)))
|
|
240 k0 = k0+1
|
|
250 wend
|
|
260 x$(j) = x$(j)+str$(k0-k)+mid$(x$(i),k,1)
|
|
270 k = k0
|
|
280 wend
|
|
290 i = j
|
|
300 print x$(j)
|
|
310 next n
|
|
320 end
|