Exemplo n.º 1
0
int main()
{
	PlatypusDuckAndBeaver a;
	cout << a.minimumAnimals(0,0,0) <<endl;
	system("pause");
	return 0;
}
double test2() {
	int p0 = 10;
	int p1 = 2;
	int p2 = 2;
	PlatypusDuckAndBeaver * obj = new PlatypusDuckAndBeaver();
	clock_t start = clock();
	int my_answer = obj->minimumAnimals(p0, p1, p2);
	clock_t end = clock();
	delete obj;
	cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl;
	int p3 = 3;
	cout <<"Desired answer: " <<endl;
	cout <<"\t" << p3 <<endl;
	cout <<"Your answer: " <<endl;
	cout <<"\t" << my_answer <<endl;
	if (p3 != my_answer) {
		cout <<"DOESN'T MATCH!!!!" <<endl <<endl;
		return -1;
	}
	else {
		cout <<"Match :-)" <<endl <<endl;
		return (double)(end-start)/CLOCKS_PER_SEC;
	}
}