#include <iostream>
using namespace std;

int f( int x )
{
	if( x<0 )
		throw "Parametar funkcije f je manji od 0!";
	if( x>10)
		throw x;
	return x * x;
}

void g( int a, int b)
{
	for( int i=a; i<=b; i++ ){
		try	{
			int y = f(i);
			cout << "f(" << i << ") = " << y << endl;
		}catch( char* s ){
			cerr << "GRESKA: " << s << endl;
		}
	}
}

main()
{
	cout << "pocetak" << endl;
	try	{
		g( -1, 12 );
	}catch(...){
		cerr << "Nepoznata greska!" << endl;
	}
	cout << "kraj" << endl;
	return 1;
}
