This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
#include <algorithm> | |
template<typename T> | |
class print | |
{ | |
public: | |
void operator()(const T& value) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
int main(int argc, char const* argv[]) | |
{ | |
int a[] = {1, 7, 8, 10, 10}; | |
int b[] = {7, 8, 10}; | |
int c[] = {8, 10, 20}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
int main(int argc, char const* argv[]) | |
{ | |
int a[] = {1, 7, 8, 10, 15}; | |
int b[] = {1, 7, 8, 0, 15}; | |
std::pair<int*, int*> iter_pair = std::mismatch(a, a+5, b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
bool even(const int&x) | |
{ | |
return !(x&1); | |
} | |
int main(int argc, char const* argv[]) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
bool two_times(int x, int y) | |
{ | |
return 2*y==x; | |
} | |
int main(int argc, char const* argv[]) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
bool two_times(int x, int y) | |
{ | |
return y==2*x; | |
} | |
int main(int argc, char const* argv[]) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
bool two_times(int x, int y) | |
{ | |
return y==2*x; | |
} | |
int main(int argc, char const* argv[]) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
bool div_by_5(int x) | |
{ | |
return !(x%5); | |
} | |
int main(int argc, char const* argv[]) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
template<typename T> | |
class print | |
{ | |
public: | |
void operator()(const T& value) | |
{ | |
std::cout << value << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
template<typename T> | |
class print | |
{ | |
public: | |
void operator()(const T& value) | |
{ | |
std::cout << value << std::endl; |