string input; getline(fin, input); int total = stoi(input);
// Each line contains the name of a group member unordered_map<string, Person*> hashmap; vector<Person*> personList; for (int i = 0; i < total; ++i) { string name; getline(fin, name); auto person = new Person(name); hashmap[name] = person; personList.push_back(person); }
/* The first line in the group tells the person's name who will be giving gifts. The second line in the group contains two numbers: The initial amount of money (in the range 0..2000) to be divided up into gifts by the giver and then the number of people to whom the giver will give gifts, NGi (0 ≤ NGi ≤ NP-1). If NGi is nonzero, each of the next NGi lines lists the the name of a recipient of a gift. */ for (int i = 0; i < total; ++i) { string name; getline(fin, name); auto person = hashmap[name];
fin >> person->money >> person->size; string newline; getline(fin, newline);