#include<iostream>
using namespace std;
void fun(int i)
{
	switch(i)
	{
	  case 0: throw 0.1;
	  case 1: throw 1;
	  case 2: throw 'c';
	}

}
void main()
{
	for(int i=0;i!=3;++i)
	{
		try{
		   fun(i);
		}
		catch(int)
		{
			cout<<"catch a int exception"<<endl;
		}
		catch(double)
		{
			cout<<"catch a double exception"<<endl;
		}
		catch(char)
		{
			cout<<"catch a char exception"<<endl;
		}
	}

}