112
unknown
c_cpp
2 years ago
1.0 kB
2
Indexable
Never
#include <iostream> using namespace std; int main() { cout << "+---------------------------------------+\n\ |1. NhapDuLieu \n|2. SapXep \n|3. Xuly \n|4. Timkiem \n|5. Luu \n|6. Mo \n|7. Thoat\n\ +----------------------------------------+\n"; bool isOk = false; while (!isOk) { char option; cin >> option; if (option < '8' && option > '0') { char confirm; while (!isOk) { cout << "Ban co muon chon yeu cau tren hay khong?\n"; cin >> confirm; if (confirm == 'y' ||confirm == 'Y' || confirm == '1') { cout << "Yes, I do\n"; isOk = true; break; } else if (confirm == 'n' || confirm == 'N' || confirm == '0') { cout << "No, I don't\n"; isOk = true; break; } else if (confirm == 'X' || confirm == 'x') { system("cls"); return 0; } else { cout << "Vui long nhap lai!\n"; } } } else { cout << "Vui long nhap lai!\n"; } } return 0; }