-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfish.h
More file actions
35 lines (33 loc) · 875 Bytes
/
fish.h
File metadata and controls
35 lines (33 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Created by Sg on 07.09.2022.
//
#pragma once
#include <vector>
#include <iostream>
#include <algorithm>
#include <random>
#include <ctime>
#include <limits>
#include "myExc.h"
using namespace std;
void vecShuffle(vector<int>& v);
void castInPond(const vector<int>& v, int n);
template<typename T>
void enterValue(T &n, T min = numeric_limits<T>::max(), T max = numeric_limits<T>::max())
{
n = max / 2;
do
{
if(!cin || (n < min || n > max))
{
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(),'\n');
cout << "-------------------Error----------------\n";
cout << min << " <= number diapason <= " << max;
cout << "\n-----------------------------------------\n";
cout << "Repeat enter:";
}
cin>>n;
}
while(!cin || (n < min || n > max));
}