Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <functional>
#include <algorithm>
template<typename T>
class print
{
public:
void operator()(const T& value)
{
#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};
#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);
#include <iostream>
#include <algorithm>
bool even(const int&x)
{
return !(x&1);
}
int main(int argc, char const* argv[])
{
#include <iostream>
#include <algorithm>
bool two_times(int x, int y)
{
return 2*y==x;
}
int main(int argc, char const* argv[])
{
#include <iostream>
#include <algorithm>
bool two_times(int x, int y)
{
return y==2*x;
}
int main(int argc, char const* argv[])
{
#include <iostream>
#include <algorithm>
bool two_times(int x, int y)
{
return y==2*x;
}
int main(int argc, char const* argv[])
{
#include <iostream>
#include <algorithm>
bool div_by_5(int x)
{
return !(x%5);
}
int main(int argc, char const* argv[])
{
#include <iostream>
#include <algorithm>
template<typename T>
class print
{
public:
void operator()(const T& value)
{
std::cout << value << std::endl;
#include <iostream>
#include <algorithm>
template<typename T>
class print
{
public:
void operator()(const T& value)
{
std::cout << value << std::endl;