suppression ancien fichier cours Pile & File, et ajout des sujets bacs NSI
This commit is contained in:
16
Sujet_bac/Pratique/BNS_2025/25-NSI-43/sujet-43.py
Normal file
16
Sujet_bac/Pratique/BNS_2025/25-NSI-43/sujet-43.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def colore_comp1(M, i, j, val):
|
||||
if M[i][j] != 1:
|
||||
return
|
||||
|
||||
M[i][j] = val
|
||||
|
||||
if i-1 >= 0: # propage en haut
|
||||
colore_comp1(M, i-1, j, val)
|
||||
if ... < len(M): # propage en bas
|
||||
colore_comp1(M, ..., j, val)
|
||||
if ...: # propage à gauche
|
||||
colore_comp1(M, ..., ..., val)
|
||||
if ...: # propage à droite
|
||||
...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user