FRstudy.me: où vos questions rencontrent des réponses expertes. Notre communauté est là pour fournir les réponses complètes et précises dont vous avez besoin pour prendre des décisions éclairées.
Sagot :
Bonsoir,
si cela peut vous aider:
CONST Faux = (0 = 1)
CONST Vrai = NOT (Faux)
DIM a AS STRING, b AS STRING, x AS INTEGER, c AS STRING
a = "ceci (est) u(n (ess)ai bi(en (di)t) coucou)"
c = a
x = Vrai
DO WHILE x
PRINT c
x = SupprPar%(c, b)
c = b
LOOP
END
FUNCTION SupprPar% (w AS STRING, w1 AS STRING)
DIM i AS INTEGER, j AS INTEGER, x2 AS INTEGER, ok AS INTEGER
ok = Faux
w1 = w
x2 = 0
FOR i = 1 TO LEN(w)
IF MID$(w, i, 1) = ")" THEN
x2 = i
FOR j = x2 - 1 TO 1 STEP -1
IF MID$(w, j, 1) = "(" THEN
w1 = ""
x1 = j
ok = Vrai
FOR k = 1 TO LEN(w)
IF NOT (x1 <= k AND k <= x2) THEN
w1 = w1 + MID$(w, k, 1)
END IF
NEXT k
EXIT FOR
END IF
NEXT j
END IF
IF ok THEN EXIT FOR
NEXT i
SupprPar% = ok
END FUNCTION
si cela peut vous aider:
CONST Faux = (0 = 1)
CONST Vrai = NOT (Faux)
DIM a AS STRING, b AS STRING, x AS INTEGER, c AS STRING
a = "ceci (est) u(n (ess)ai bi(en (di)t) coucou)"
c = a
x = Vrai
DO WHILE x
PRINT c
x = SupprPar%(c, b)
c = b
LOOP
END
FUNCTION SupprPar% (w AS STRING, w1 AS STRING)
DIM i AS INTEGER, j AS INTEGER, x2 AS INTEGER, ok AS INTEGER
ok = Faux
w1 = w
x2 = 0
FOR i = 1 TO LEN(w)
IF MID$(w, i, 1) = ")" THEN
x2 = i
FOR j = x2 - 1 TO 1 STEP -1
IF MID$(w, j, 1) = "(" THEN
w1 = ""
x1 = j
ok = Vrai
FOR k = 1 TO LEN(w)
IF NOT (x1 <= k AND k <= x2) THEN
w1 = w1 + MID$(w, k, 1)
END IF
NEXT k
EXIT FOR
END IF
NEXT j
END IF
IF ok THEN EXIT FOR
NEXT i
SupprPar% = ok
END FUNCTION
Nous sommes ravis de vous avoir parmi nous. Continuez à poser des questions et à partager vos réponses. Ensemble, nous pouvons créer une ressource de connaissances précieuse pour tous. Vous avez des questions? FRstudy.me a les réponses. Merci pour votre visite et à bientôt.