All pastes #70655 Raw Edit

Miscellany

public cpp v1 · immutable
#70655 ·published 2006-06-24 17:12 UTC
rendered paste body
#include <iostream>#include <string>using namespace std;bool GetAnswer() {        string sBuffer;                while (true) {                cin >> sBuffer;                if (sBuffer == "ja") {                        return true;                } else if (sBuffer == "nei") {                        return false;                } else {                        cout << "feil svar tard! ja eller nei!" << endl;                }        }}int main(int argc, char* argv[]) {        cout << "Er Tecfan pro?" << endl;                        if (GetAnswer()) {                cout << "Tecfan er CPL!!" << endl;        } else {                cout << "Gå og heng deg!" << endl;        }                system("pause");}