/*
* exception.cpp
*
* Created on: 2014年10月31日
* Author: Administrator
*/
#include<iostream>
#include<string>
using namespace std;
double test_excpetion(int num);
int main(){
try{
cout << test_excpetion(0) << endl;
}catch(const char *cp){
cout << cp << endl;
}
return 0;
}
double test_excpetion(int num){
if(num == 0){
throw "occur exception..";
}
return 5/num;
}