TP7
This commit is contained in:
25
TP7/Pays.cpp
Normal file
25
TP7/Pays.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#include "Pays.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void Pays::saisie(ifstream &in) {
|
||||
getline(in, Region, ';');
|
||||
getline(in, Nom, ';');
|
||||
|
||||
getfloat(in, Population, ';');
|
||||
// Pas dans le fichier :(
|
||||
// getfloat(in, Area, ';');
|
||||
|
||||
// "trim" en c++
|
||||
auto end = Nom.end();
|
||||
while (*(end-1) == ' ')
|
||||
end--;
|
||||
Nom.erase(end, Nom.end());
|
||||
}
|
||||
|
||||
void Pays::affichage() {
|
||||
cout << Region << " " << Nom << " " << Population;
|
||||
}
|
||||
Reference in New Issue
Block a user