Auto urgent commit.

This commit is contained in:
2025-04-02 09:50:49 +02:00
parent a1ed22e8dd
commit ff8412afc1
6 changed files with 1474 additions and 2 deletions

1412
get_bac_subject/get_bac_subject/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
[package]
name = "get_bac_subject"
version = "0.1.0"
edition = "2021"
[dependencies]
reqwest = { version = "0.11", features = ["blocking"] }

View File

@@ -0,0 +1,19 @@
fn download_file(url: &str, output_path: &str) -> Result<(), Box<dyn std::error::Error>> {
let response = get(url)?;
if !response.status().is_success()
let mut dest = File::create(Path::new(output_path))?;
let mut content = response;
copy(&mut content, &mut dest)?;
println!("📥 Downloaded: {}{}", url, output_path);
Ok(())
}
fn main() {
let url = "https://drive.proton.me/urls/XZ780G6P1M#kXUbcVjBlXPJ";
let output = "sujets.zip";
if let Err(e) = download_file(url, output) {
eprintln!("❌ Erreur: {}", e);
}
}

View File

@@ -0,0 +1 @@
https://drive.proton.me/urls/XZ780G6P1M#kXUbcVjBlXPJ

View File

@@ -161,5 +161,37 @@ if __name__ == "__main__":
liste1
) # on observer que la liste devient triée (logique car on la trie pour la mettre dans l'arbre et on ne peut pas la recupérer comme si elle ne l'etait pas)
# Exercice 5 ?
pass
tas = [1, 5, 8, 10, 11, 12, 18, 19, 20, 23, 29, 73]
def ajouter(tas, element):
tas.append(element)
i = len(tas) - 1
while i > 0:
parent = (i - 1) // 2
if tas[i] < tas[parent]:
tas[i], tas[parent] = tas[parent], tas[i]
i = parent
else:
break
# nlog(n)
class Tas_Max(object):
@staticmethod
def parent(i):
return (i-1)//2
@staticmethod
def enfant_gauche(i):
return 2*i+1
@staticmethod
def enfant_droite(i):
return 2*i+2
# exercice 6:1. Proposer une méthode dextraction de la racine.
def extract_racine(tas):
racine = tas.pop()

0
trees/ABR/main.py Normal file
View File