#include "wektor.h"
#include <iostream>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <iostream>
#include <functional>
#include <ctime>

using namespace std;

class aa
{
public:
	bool operator()(int a)
	{
		if (a<3) return true;
		else return false;
	}
};


int main()
{

	Wektor<int> w1;

	for(int i=1;i<=49;i++) w1.Dodaj(i); 

	cout << "Zawartosc ektora\n";
	Wektor<int>::iterator it;
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;

	srand(time(NULL));

	cout << "Random shuffle (numery lotto)\n";
	random_shuffle(w1.begin(),w1.end());
	for(it=w1.begin();it!=w1.begin()+6;it++)
		cout << *it << " ";
	cout << endl;


	cout << "Sortowanie\n";
	sort(w1.begin(),w1.end());
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;


	cout << "Reverse\n";
	reverse(w1.begin(),w1.end());
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;

	cout << "Fill (pierwsze 10 elementow = -1)\n";
	fill(w1.begin(),w1.begin()+10,-1);
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;

	cout << "Rotate \n";
	rotate(w1.begin(),w1.begin()+w1.IleElementow()-1,w1.end());
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;

	
	cout << "Replace (zamien -1 na 0)\n";
	replace(w1.begin(),w1.end(),-1,0);
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;
	
	/*cout << "Remove\n";
	remove(w1.begin(),w1.end(),0);
	for(it=w1.begin();it!=w1.end();it++)
		cout << *it << " ";
	cout << endl;
	*/
	
	cout << "Count = " << count(w1.begin(),w1.end(),0) << endl;

	aa a;
	cout << "Count if < 3 " << count_if(w1.begin(),w1.end(),a) << endl;

	int *m = min_element(w1.begin()+11,w1.end()) ;
	cout << "min=" << *m << endl;
}