SkeptaProgrammer

Untitled

Nov 14th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int Input(int lowBorder, int highBorder)
  6. {
  7. int input;
  8.  
  9. while (!(cin >> input && input >= lowBorder && input < highBorder))
  10. {
  11. cout << "\nВвод некорректен. Повторите ввод: ";
  12. cin.clear();
  13. while (cin.get() != '\n');
  14. }
  15. while (cin.get() != '\n');
  16. return input;
  17. }
Add Comment
Please, Sign In to add comment