First commit

This commit is contained in:
2026-04-08 20:11:20 +02:00
parent 10fe469c10
commit 79f15536a1
861 changed files with 135610 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,57 @@
#include <iostream>
#include "fonction.h"
using namespace std;
// int saisiePromo(
// struct Etudiant promo[],
// unsigned int taille_relle)
// {
// unsigned int i = 0;
// do
// {
// char nom[21];
// char prenom[21];
// float moyenne_generale;
// unsigned int scolarisation;
// cout << "Saisissez le nom de l'étudiant" << endl;
// cin >> nom;
// cout << "Saisissez le prenom de l'étudiant" << endl;
// cin >> prenom;
// cout << "Saisissez la moyenne de l'étudiant" << endl;
// cin >> moyenne_generale;
// cout << "Saisissez la scolarisation de l'étudiant" << endl;
// cin >> scolarisation;
// if (
// moyenne_generale >= 0 and moyenne_generale <= 20
// and scolarisation <= 1
// ) {
// promo[i] = {nom, prenom, moyenne_generale, scolarisation};
// i++;
// }
// }
// return i+1;
// }
unsigned int filtreDemission(
struct Etudiant promo[],
const unsigned int taille_pratique
) {
unsigned int decompte = taille_pratique;
struct Etudiant temporaire;
// Tri par selection...
for (unsigned int j = 0; j < taille_pratique-1; j++) {
for (unsigned int i = 0; i < taille_pratique-1; i++)
if (promo[i].scolarisation == 0) {
temporaire = promo[i];
promo[i] = promo[i+1];
promo[i+1] = temporaire;
}
}
}

View File

@@ -0,0 +1,34 @@
struct Etudiant {
char nom[21];
char prenom[21];
float moyenne_generale;
unsigned int scolarisation; // 1 pour scolarisé, 0 pour déscolarisé
};
struct Node {
struct Etudiant racine;
struct Node gauche;
struct Node droit;
}
unsigned int heapsortPromo(
struct Etudiant promo[],
unsigned int taille_pratique
);
unsigned int saisiePromo(
struct Etudiant promo[],
unsigned int taille_relle
);
unsigned int filtreDemission(
struct Etudiant promo[],
unsigned int taille_pratique
);
float moyenne(
struct Etudiant promo[],
unsigned int taille_pratique
);

View File

@@ -0,0 +1,21 @@
#include "fonction.h"
#include <iostream>
using namespace std;
int main() {
unsigned int nb_etu_initial;
unsigned int nb_etu_jury;
float moyenne_promo;
nb_etu_initial = saisiePromo();
nb_etu_jury = filtreDemission();
moyenne_promo = moyenne();
cout << "La moyenne de promotion est de : " << moyenne_promo << endl;
return 0;
}

View File

@@ -0,0 +1,18 @@
def tri_selection(tab):
for _ in range(len(tab) - 1):
for j in range(len(tab)-1):
if tab[j] == 0:
temp = tab[j]
tab[j] = tab[j+1]
tab[j+1] = temp
return tab
liste = [0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0]
tri1 = tri_selection(liste)
print(liste)
print(tri1)