Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void PrintVector(const vector<double>& vect) {
- for (double x : vect) {
- cout << x << " ";
- }
- }
- bool IsInt(double element) {
- if (element - static_cast<int>(element) == 0) {
- return true;
- }
- else return false;
- }
- bool CheckSolution(const vector<double>& vect) {
- for (size_t i = 0; i < vect.size()-1; i++) {
- if (IsInt(vect[i]) == IsInt(vect[i + 1])) {
- return false;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement