4 #include "../boys/allboys.h" 5 #include "../girls/allgirls.h" 6 #include "../gifts/gift.h" 7 #include "../couples/couple.h" 8 #include "../utils/read_data.h" 9 #include "../utils/couple_utils.h" 10 #include "../utils/logger/logger.h" 12 #include "../configs.h" 14 int main(
int argc,
char **argv)
25 logger.
info(
"Processing for question 5",
true);
26 logger.
log(
"boys", std::to_string(boys.size()) +
" record read",
true);
27 logger.
log(
"girls", std::to_string(girls.size()) +
" record read",
true);
28 logger.
log(
"gifts", std::to_string(gifts.size()) +
" record read",
true);
32 logger.
log(
"couples", std::to_string(couples.size()) +
" formed",
true);
34 logger.
info(
"Couples list",
true);
35 for (
int i = 0; i < (int)couples.size(); i++)
36 logger.
log(
"couple"+std::to_string(i+1),
37 couples[i].boy->name+
" and "+couples[i].girl->name,
true);
41 if (k > (
int)couples.size()) {
42 logger.
log(
"Error",
"K is more than couples",
true);
47 logger.
info(std::to_string(k)+
" happiest Couples list",
true);
48 for (
int i = 0; i < (int)hc.size(); i++)
49 logger.
log(
"couple"+std::to_string(i+1),
50 hc[i].boy->name+
" and "+hc[i].girl->name,
true);
std::vector< Gift > readAllGifts(std::string filename)
void info(const std::string msg, bool print=false)
int main(int argc, char **argv)
void log(const std::string type, const std::string msg, bool print=false)
std::vector< Couple > makeCouplesAlternatively(std::vector< Boy * > boys, std::vector< Girl * > girls, Logger *logger)
std::vector< Girl * > readAllGirls(std::string filename)
std::vector< Boy * > readAllBoys(std::string filename)
std::vector< Couple > getKHappiestCouples(std::vector< Couple > couples, int k)
void performGifting(int k, std::vector< Couple > *couples, std::vector< Gift > *giftlist, Logger *logger)