Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <limits>
  2. #include <exception>
  3. #include <iostream>
  4. template <typename T> T scan() {
  5. T val;
  6. std::cin >> val;
  7. if (std::cin.good()) {
  8. std::cout << "Малаца" << std::endl;
  9. return val;
  10. } else {
  11. std::cin.clear();
  12. std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
  13. std::cout << "Долбоёб штоле?" << std::endl;
  14. throw std::exception();
  15. }
  16. }
  17.  
  18. // double foo = scan<double>();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement