1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
string line;
getline(in, line);
line.erase(0, 1);
line.erase(0, line.find_first_not_of(' '));
t = new node(line, 0, 0);
while(in){
getline(in, line);
//cout << line << endl;
if(line[0] == 'Q'){
line.erase(0, 1);
line.erase(0, line.find_first_not_of(' '));
string nextQuestion = line;
t->ifYes = new node(nextQuestion, 0, 0);
}
else if(line[0] == 'A'){
line.erase(0, 1);
line.erase(0, line.find_first_not_of(' '));
string answer = line;
t->ifNo = new node(answer, 0, 0);
}
|