Première version (trop lente)
This commit is contained in:
parent
10f6668664
commit
1a4bf80d27
1 changed files with 26 additions and 0 deletions
26
jour10/jour10.bs
Normal file
26
jour10/jour10.bs
Normal file
|
@ -0,0 +1,26 @@
|
|||
basInput$ = "1113222113"
|
||||
pred$ = ""
|
||||
act$ = ""
|
||||
new$ = ""
|
||||
k = 0
|
||||
|
||||
for i = 0 to 40
|
||||
print i, " / 40"
|
||||
for j = 1 to len(basInput$) step k
|
||||
k = 1
|
||||
act$ = mid$(basInput$, j, 1)
|
||||
pred$ = act$
|
||||
while pred$ = act$ and (j + k) < len(basInput$)
|
||||
pred$ = act$
|
||||
act$ = mid$(basInput$, j + k, 1)
|
||||
k = k + 1
|
||||
if act$ <> pred$ then
|
||||
k = k - 1
|
||||
endif
|
||||
wend
|
||||
new$ = new$ + str$(k) + pred$
|
||||
next j
|
||||
basInput$ = new$
|
||||
next i
|
||||
|
||||
print "La longeur de la chaine finale est ", len(basInput$)
|
Loading…
Reference in a new issue