GIP 10

#include 

using namespace std;

const int anfangsbestand = 13;

int rehe_i(int jahr)
{
	int reh = anfangsbestand;

	for(int i=1; i <= jahr ; i++)
	{
		cout << reh << " -> ";

		reh = ((reh * 3) - 10);
		if(reh > 40)
			reh = reh - (reh * 0.6);

		cout << reh << endl;
	}

	return reh;
}

int rehe_r(int jahr, int reh=anfangsbestand)
{
	cout << reh << " -> ";
	
	reh = ((reh * 3) - 10);
	if(reh > 40)
		reh = (reh - (reh * 0.6));

	cout << reh << endl;

	if(jahr <= 1)
		return reh;
	return rehe_r(--jahr, reh);
}


int main ()
{
	cout << "Iterativ: Ende des 3. Jahres: " << rehe_i(3) << " Rehe\n";
	cout << "Rekursiv: Ende des 3. Jahres: " << rehe_r(3) << " Rehe\n";
	return 0;
}