TP7 : Mise à jour avec les fichiers moodle
This commit is contained in:
13
TP7/main.cpp
13
TP7/main.cpp
@@ -23,7 +23,7 @@ void lire(M& map, const string filename) {
|
||||
return;
|
||||
}
|
||||
|
||||
f.ignore(200, '\n');
|
||||
//f.ignore(200, '\n');
|
||||
while (!f.eof()) {
|
||||
V a;
|
||||
a.saisie(f);
|
||||
@@ -32,7 +32,7 @@ void lire(M& map, const string filename) {
|
||||
// map[a.key()] = a;
|
||||
map.insert(make_pair(a.key(), a));
|
||||
|
||||
f.ignore(2000, '\n');
|
||||
// f.ignore(2000, '\n');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,6 @@ void affichage(M& map) {
|
||||
affichage_range(map.begin(), map.end());
|
||||
}
|
||||
|
||||
|
||||
|
||||
void chercher(const map<string, Entreprise>& entreprises) {
|
||||
string r;
|
||||
|
||||
@@ -77,6 +75,7 @@ void chercher(const map<string, Entreprise>& entreprises) {
|
||||
cout << "Entreprise trouvée!" << endl;
|
||||
Entreprise e = it->second;
|
||||
e.affichage();
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -117,11 +116,17 @@ void entreprises_ranking(const map<string, Entreprise>& entreprises) {
|
||||
cout << "Le turnover maximum est : " << e_max->second.getTurnover() << " pour l'entreprise " << e_max->first << endl;
|
||||
}
|
||||
|
||||
void toupper(string& s) {
|
||||
for (int i = 0; i < s.size(); i++)
|
||||
s[i] = toupper(s[i]);
|
||||
}
|
||||
|
||||
void pays_region( const multimap<string, Pays>& pays) {
|
||||
string recherche;
|
||||
|
||||
cout << "Entrez le nom de la région cherchée: ";
|
||||
getline(cin, recherche);
|
||||
toupper(recherche);
|
||||
|
||||
auto range = pays.equal_range(recherche);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user