suppression ancien fichier cours Pile & File, et ajout des sujets bacs NSI
This commit is contained in:
19
Sujet_bac/Pratique/BNS_2025/25-NSI-11/25-NSI-11.py
Normal file
19
Sujet_bac/Pratique/BNS_2025/25-NSI-11/25-NSI-11.py
Normal file
@@ -0,0 +1,19 @@
|
||||
def somme_max(tab):
|
||||
n = len(tab)
|
||||
sommes_max = [0]*n
|
||||
sommes_max[0] = tab[0]
|
||||
# on calcule la plus grande somme se terminant en i
|
||||
for i in range(1,n):
|
||||
if ... + ... > ...:
|
||||
sommes_max[i] = ...
|
||||
else:
|
||||
sommes_max[i] = ...
|
||||
# on en déduit la plus grande somme de celles-ci
|
||||
maximum = 0
|
||||
for i in range(1, n):
|
||||
if ... > ...:
|
||||
maximum = i
|
||||
|
||||
return sommes_max[...]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user