1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| 3 : {
Trier par Nom
Structure personne
Nom en caractère * 20
Prénom en caractère * 15
Age en caractère *3
Fin structure personne
Ouvrir "Recensement.txt sur 3 pour Lecture
i <- i+1
Redim tableau(i)
Lire fichier 3, personne
Si personne.nom > Nom et Non Inséré Alors
tableau(i) <- personne
Inséré <- Vrai
i <- i + 1
Redim tableau(i)
Finsi
tableau(i)<- personne
Fermer 3
Ouvrir "Recensement.txt" sur 3 pour Ecriture
Pour j <- 0 à i
EcrireFichier 3, tableau(j)
j suivant
Fermer 3
Fin
Ecrire "Noms triés"
Trier par âge
Ouvrir "Recensement.txt sur 3 pour Lecture
i <- i+1
Redim tableau(i)
Lire fichier 3, personne
Si personne.age > Age et Non Inséré Alors
tableau(i) <- personne
Inséré <- Vrai
i <- i + 1
Redim tableau(i)
Finsi
tableau(i)<- personne
Fermer 3
Ouvrir "Recensement.txt" sur 3 pour Lecture
Pour j <- 0 à i
EcrireFichier 3, tableau(j)
j suivant
Fermer 3
Fin
} |
Partager