parent
3e4af5d7df
commit
0d450aaca5
Binary file not shown.
@ -1,56 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
|
||||||
// Ouverture du fichier en mode écriture
|
|
||||||
FILE* f = fopen("resultats.txt", "w");
|
|
||||||
if (f == NULL) {
|
|
||||||
printf("Error opening file!\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialisation du générateur de nombres aléatoires
|
|
||||||
srand(time(0));
|
|
||||||
|
|
||||||
// Écriture des en-têtes de colonnes
|
|
||||||
fprintf(f, "Numero de candidat\tNom\tPrenom\tNote de maths\tNote de francais\tNote d'anglais\tNote de specialite\tNombre de choix de candidatures\tVille choisie de la premiere candidature\tDepartement\tDecision du departement\tValidation\n");
|
|
||||||
|
|
||||||
// Génération de données aléatoires pour chaque candidat
|
|
||||||
for (int i = 1; i <= 100; i++) {
|
|
||||||
char nom[21];
|
|
||||||
for (int j = 0; j < 20; j++) {
|
|
||||||
nom[j] = rand() % 26 + 'a';
|
|
||||||
}
|
|
||||||
nom[0] = toupper(nom[0]);
|
|
||||||
char prenom[21];
|
|
||||||
for (int j = 0; j < 20; j++) {
|
|
||||||
prenom[j] = rand() % 26 + 'a';
|
|
||||||
}
|
|
||||||
char note_maths[3];
|
|
||||||
sprintf(note_maths, "%d", rand() % 21);
|
|
||||||
char note_francais[3];
|
|
||||||
sprintf(note_francais, "%d", rand() % 21);
|
|
||||||
char note_anglais[3];
|
|
||||||
sprintf(note_anglais, "%d", rand() % 21);
|
|
||||||
char note_specialite[3];
|
|
||||||
sprintf(note_specialite, "%d", rand() % 21);
|
|
||||||
char nb_choix[2];
|
|
||||||
sprintf(nb_choix, "%d", rand() % 6);
|
|
||||||
char ville[] = "Clermont-Ferrand";
|
|
||||||
char departement1[14];
|
|
||||||
sprintf(departement1, "Departement%d", rand() % 21);
|
|
||||||
char departement2[14];
|
|
||||||
sprintf(departement2, "Departement%d", rand() % 21);
|
|
||||||
char departement3[14];
|
|
||||||
sprintf(departement3, "Departement%d", rand() % 21);
|
|
||||||
char departement4[14];
|
|
||||||
sprintf(departement4, "Departement%d", rand() % 21);
|
|
||||||
char departement5[14];
|
|
||||||
sprintf(departement5, "Departement%d", rand() % 21);
|
|
||||||
char decision[] = "0";
|
|
||||||
char validation[] = "0";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
import random
|
|
||||||
|
|
||||||
# Ouverture du fichier en mode écriture
|
|
||||||
with open("resultats.txt", "w") as f:
|
|
||||||
# Écriture des en-têtes de colonnes
|
|
||||||
f.write("Numero de candidat\tNom\tPrenom\tNote de maths\tNote de francais\tNote d'anglais\tNote de specialite\tNombre de choix de candidatures\tVille choisie de la premiere candidature\tDepartement\tDecision du departement\tValidation\n")
|
|
||||||
|
|
||||||
# Génération de données aléatoires pour chaque candidat
|
|
||||||
for i in range(1, 100):
|
|
||||||
nom = "Nom" + str(i)
|
|
||||||
prenom = "Prenom" + str(i)
|
|
||||||
note_maths = str(random.randint(0, 20))
|
|
||||||
note_francais = str(random.randint(0, 20))
|
|
||||||
note_anglais = str(random.randint(0, 20))
|
|
||||||
note_specialite = str(random.randint(0, 20))
|
|
||||||
nb_choix = str(random.randint(1, 5))
|
|
||||||
ville1 = "Ville" + str(random.randint(1, 60))
|
|
||||||
ville2 = "Ville" + str(random.randint(1, 60))
|
|
||||||
ville3 = "Ville" + str(random.randint(1, 60))
|
|
||||||
ville4 = "Ville" + str(random.randint(1, 60))
|
|
||||||
ville5 = "Ville" + str(random.randint(1, 60))
|
|
||||||
ville1 != ville2 != ville3 != ville4 != ville5
|
|
||||||
departement1 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement2 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement3 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement4 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement5 = "Departement" + str(random.randint(1, 20))
|
|
||||||
decision1 = str(random.randint(-1, 1))
|
|
||||||
decision2 = str(random.randint(-1, 1))
|
|
||||||
decision3 = str(random.randint(-1, 1))
|
|
||||||
decision4 = str(random.randint(-1, 1))
|
|
||||||
decision5 = str(random.randint(-1, 1))
|
|
||||||
validation1 = str(random.randint(0, 1))
|
|
||||||
validation2 = str(random.randint(0, 1))
|
|
||||||
validation3 = str(random.randint(0, 1))
|
|
||||||
validation4 = str(random.randint(0, 1))
|
|
||||||
validation5 = str(random.randint(0, 1))
|
|
||||||
|
|
||||||
#f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville + "\t" + departement + "\t" + decision + "\t" + validation + "\n" )
|
|
||||||
# Écriture des données dans le fichier, séparées par des points-virgules
|
|
||||||
if nb_choix == "1":
|
|
||||||
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\n")
|
|
||||||
elif nb_choix == "2":
|
|
||||||
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\n")
|
|
||||||
elif nb_choix == "3":
|
|
||||||
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\t" + ville3 + "\t" + departement3 + "\t" + decision3 + "\t" + validation3 + "\n")
|
|
||||||
elif nb_choix == "4":
|
|
||||||
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\t" + ville3 + "\t" + departement3 + "\t" + decision3 + "\t" + validation3 + "\t" + ville4 + "\t" + departement4 + "\t" + decision4 + "\t" + validation4 + "\n")
|
|
||||||
elif nb_choix == "5":
|
|
||||||
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\t" + ville3 + "\t" + departement3 + "\t" + decision3 + "\t" + validation3 + "\t" + ville4 + "\t" + departement4 + "\t" + decision4 + "\t" + validation4 + "\t" + ville5 + "\t" + departement5 + "\t" + decision5 + "\t" + validation5 + "\n")
|
|
@ -1,38 +0,0 @@
|
|||||||
import random
|
|
||||||
import string
|
|
||||||
|
|
||||||
# Ouverture du fichier en mode écriture
|
|
||||||
with open("resultats.txt", "w") as f:
|
|
||||||
# Écriture des en-têtes de colonnes
|
|
||||||
# Génération de données aléatoires pour chaque candidat
|
|
||||||
for i in range(1, 100):
|
|
||||||
nom = ''.join(random.choices(string.ascii_lowercase, k=20))
|
|
||||||
nom = nom.capitalize()
|
|
||||||
prenom = ''.join(random.choices(string.ascii_lowercase, k=20))
|
|
||||||
note_maths = str(random.randint(0, 20))
|
|
||||||
note_francais = str(random.randint(0, 20))
|
|
||||||
note_anglais = str(random.randint(0, 20))
|
|
||||||
note_specialite = str(random.randint(0, 20))
|
|
||||||
nb_choix = str(random.randint(1, 5))
|
|
||||||
ville = "Clermont-Ferrand"
|
|
||||||
departement1 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement2 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement3 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement4 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement5 = "Departement" + str(random.randint(1, 20))
|
|
||||||
departement1 != departement2 != departement3 != departement4 != departement5
|
|
||||||
decision = "0"
|
|
||||||
validation = "0"
|
|
||||||
|
|
||||||
#f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville + "\t" + departement + "\t" + decision + "\t" + validation + "\n" )
|
|
||||||
# Écriture des données dans le fichier, séparées par des points-virgules
|
|
||||||
if nb_choix == "1":
|
|
||||||
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n")
|
|
||||||
elif nb_choix == "2":
|
|
||||||
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n")
|
|
||||||
elif nb_choix == "3":
|
|
||||||
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement3 + "\n" + decision + "\n" + validation + "\n")
|
|
||||||
elif nb_choix == "4":
|
|
||||||
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement3 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement4 + "\n" + decision + "\n" + validation + "\n")
|
|
||||||
elif nb_choix == "5":
|
|
||||||
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement3 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement4 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement5 + "\n" + decision + "\n" + validation + "\n")
|
|
@ -1 +0,0 @@
|
|||||||
Numero de candidat Nom Prenom Note de maths Note de francais Note d'anglais Note de specialite Nombre de choix de candidatures Ville choisie de la premiere candidature Departement Decision du departement Validation
|
|
Binary file not shown.
Loading…
Reference in new issue