How can i get the digits out from file and the player who scored the most points?
Input file to read from
Match A score: 3-1
Mark
Peter
Peter
Match B score: 1-1
Jim
underlined - player who scored the points
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line;
ifstream myfile ("inputFile.txt");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
// how to get the variable and players name?
}
myfile.close();
}
else cout << "Unable to open file";
return 0;
}