Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <limits>
- #include <exception>
- #include <iostream>
- template <typename T> T scan() {
- T val;
- std::cin >> val;
- if (std::cin.good()) {
- std::cout << "Малаца" << std::endl;
- return val;
- } else {
- std::cin.clear();
- std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
- std::cout << "Долбоёб штоле?" << std::endl;
- throw std::exception();
- }
- }
- // double foo = scan<double>();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement