Implémentez le programme déclaré dans
1.1.h (copié ci-dessous) dans un fichier
1.1.cc. Ne modifiez pas 1.1.h !
#include <functional>
#include <string>
#include <vector>
using std::string;
using std::vector;
struct Student {
string name; // Eg. "John Smith"
int number; // Identification number, eg. "12345678"
double grade; // Global grade over 20.0, eg. 15.5.
};
// Sorts students by name, lexicographically: "Aab" before "Ac".
void SortStudentsByName(vector<Student>* students);
// Sorts students by their identification number modulo M: 0 before 1.
void SortStudentsByNumberModulo(vector<Student>* students, int M);
// Applies the given function to each student inside the vector.
void ApplyFunctionToStudents(std::function<void(Student*)> fun,
vector<Student>* students);
Testez votre code:
rm 1.tar.gz; wget --no-cache http://fabien.viger.free.fr/cpp/td15/1.tar.gz
tar xf 1.tar.gz
make 1.1
RENDU: 1.1.cc