Feat(NSI): fait le DS4
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-03-30 18:42:50 +02:00
parent 04c90a07c2
commit cd31d3293c
16 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
<article>
<h1>Les auteurs de ce site</h1>
<button onclick="auteurs()">Appuyer ici</button>
</article>
<script src="java_script/ScriptJava.js"></script>
<script> function auteurs() { alert("Auteurs anonymes"); } </script>

View File

@@ -0,0 +1,5 @@
a = 1
cpt = 1
while cpt < 8:
a = 2*a
cpt = cpt+1

View File

@@ -0,0 +1,9 @@
def maxi(L):
dernier_indice = len(L) - 1
valeur_max = L[0]
for i in range(1,dernier_indice):
if L[i] > valeur_max:
valeur_max = liste[i]
return valeur_max

View File

@@ -0,0 +1,6 @@
def minimum(L):
mini = 0
for e in L:
if e < mini:
mini = e
return mini

View File

@@ -0,0 +1,7 @@
liste = [17, 12, 5, 18, 2, 7, 9, 15, 14, 20]
somme = 0
i = 0
while i < len(liste):
somme = somme + liste[i]
i = i + 1
resultat = somme / len(liste)

View File

@@ -0,0 +1,5 @@
def produit (L):
p = ...
for elt in L:
.......
return p

View File

@@ -0,0 +1,6 @@
def mystere(T):
s = 0
for k in T:
if k % 2 == 0:
s = s+k
return s

View File

@@ -0,0 +1,9 @@
def pgsp(lst:list):
n = len(lst)
somme_max = lst[0]
for i in range(n):
for j in range(i, n):
s = somme_sous_sequence(lst, i, j)
if s > somme_max :
somme_max = s
return somme_max

View File

@@ -0,0 +1,8 @@
def pgsp2(lst:list):
sommes_max = [lst[0]]
for i in range(1, len(lst)):
if lst[i] > (sommes_max[-1] + lst[i]):
sommes_max.append(lst[i])
else:
sommes_max.append(sommes_max[-1] + lst[i])
return maximum(sommes_max)