Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int getMatrixItem()
- {
- int ret;
- bool isIncorrect;
- string inputLine;
- do
- {
- cout << "Введите значение элемента матрицы";
- getline(cin, inputLine);
- isIncorrect = false;
- try
- {
- ret = stoi(inputLine);
- }
- catch (...)
- {
- isIncorrect = true;
- cout << "Значение матрицы должно быть числом\n";
- }
- } while (isIncorrect);
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement