All pastes #70755 Raw Edit

Untitled

public text v1 · immutable
#70755 ·published 2006-06-24 19:53 UTC
rendered paste body
bool GetAnswer() {
        string sBuffer;
        
        while (true) {
                cin >> sBuffer;
                transform(sBuffer.begin(), sBuffer.end(), sBuffer.begin(), (int(*)(int)) std::tolower);
                
                if (sBuffer == "ja") {
                        return true;
                } else if (sBuffer == "nei") {
                        return false;
                } else {
                        cout << "Svar \"Ja\" eller \"Nei\"!" << endl;
                }
        }
}