Advertisement
dxvmxnd

Untitled

Oct 27th, 2024
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. int exceptRead(int i, int j) {
  2. bool isNotCorrect;
  3. int number;
  4.  
  5. number = 0;
  6. do {
  7. isNotCorrect = false;
  8. cout << "Введите " << (i + 1) << "," << (j + 1) << " пункт матрицы." << endl;
  9. cin >> number;
  10. if (cin.fail()) {
  11. isNotCorrect = true;
  12. cout << "Неверный ввод данных!" << endl;
  13. cin.clear();
  14. while (cin.get() != '\n');
  15. }
  16. } while (isNotCorrect);
  17.  
  18. return number;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement