daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. std::cout<<"t"<<"Ваш класс       -   " ;
  2. std::cin>>klass;
  3.    
  4. int N;
  5. for (;;) {
  6.     std::cout << " Введите целое от min до max: " << std::flush;
  7.     if ((std::cin >> N).good() && (min <= N) && (N <= max)) break;
  8.     if (std::cin.fail()) {
  9.         std::cin.clear();
  10.         std::cout << "Неверный ввод, повторите.n";
  11.     } else {
  12.         std::cout << "Число вне допустимого диапазона значений. Повторите ввод.n";
  13.     }
  14.     std::cin.ignore(std::numeric_limits<std::streamsize>::max(),'n');
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top