Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main() {
- char a; std::string answer;
- do {
- std::cout << "Write symbol " <<;
- std::cin >> a;
- std::cout << "Continue? (yes or no)";
- std::cin.clear();
- std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
- do {
- std::getline(std::cin, answer);
- if (answer != "yes" && answer != "no") { std::cout << "You didn't write answer. Try again." << std::endl; }
- } while(answer !="yes" && answer!="no");
- } while (answer !="no");
- std::cout << a << ", " << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement