1234567891011121314151617181920
int main() { Calculator x; double op1, op2; char op; char rep; do { cout << ">"; cin >> op1 >> op >> op2; cout << x.calc(op1, op2, op) << endl; cout << "Again (y/n)? "; cin >> rep; while (rep != 'n'|| rep != 'y') { cout << "Error\n"; cout << "Another (y/n)? "; cin >> rep; } } while(rep != 'n'); return 0; }
rep != 'n'|| rep != 'y'
rep == n
12345678910111213141516171819202122
int main() { Calculator x; double op1, op2; char op; char rep; do { cout << ">"; cin >> op1 >> op >> op2; cout << x.calc(op1, op2, op) << endl; cout << "Again (y/n)? "; cin >> rep; if (rep != 'n' && rep != 'y') do { cout << "Error\n"; cout << "Again (y/n)? "; cin >> rep; } while (rep != 'n' && rep != 'y'); } while(rep != 'n'); return 0; }
while (rep != 'n' && rep != 'y')