#include #include #include #include #include std::string slurp(std::ifstream& in) { std::ostringstream sstr; sstr << in.rdbuf(); return sstr.str(); } struct ScoreData{ int difficulty=0; std::string song; int totalEX=0; int ex1=0,ex2=0,ex3=0; std::string str()const{ return "["+std::to_string(difficulty)+"] "+song+": "+std::to_string(totalEX)+" total, "+" EX1: "+std::to_string(ex1)+" EX2: "+std::to_string(ex2)+" EX3: "+std::to_string(ex3); } friend std::ostream&operator<<(std::ostream&os,const ScoreData&data){ os<dataA,dataB; std::vector>player1Score,player2Score,player3Score; std::ifstream file("team.csv"); std::string line; //First two lines are garbage data. std::getline(file,line); std::getline(file,line); for(int i=0;i<12;i++){ std::getline(file,line); int marker=0; ScoreData dat{ stoi(GetNext(marker,line)), GetNext(marker,line), stoi(GetNext(marker,line)), stoi(GetNext(marker,line)), stoi(GetNext(marker,line)), stoi(GetNext(marker,line))}; player1Score.emplace_back(std::pair{dat.ex1,0}); player2Score.emplace_back(std::pair{dat.ex2,0}); player3Score.emplace_back(std::pair{dat.ex3,0}); dataA.emplace_back(dat); } //Two more lines of garbage data. std::getline(file,line); std::getline(file,line); for(int i=0;i<12;i++){ std::getline(file,line); int marker=0; ScoreData dat{ stoi(GetNext(marker,line)), GetNext(marker,line), stoi(GetNext(marker,line)), stoi(GetNext(marker,line)), stoi(GetNext(marker,line)), stoi(GetNext(marker,line))}; player1Score[i].second=dat.ex1; player2Score[i].second=dat.ex2; player3Score[i].second=dat.ex3; dataB.emplace_back(dat); } std::cout<<"File Contents:"<