| 6 | using namespace std; |
| 7 | |
| 8 | void temperature(int t) |
| 9 | { |
| 10 | try{ |
| 11 | if (t==100) { |
| 12 | throw "It's at the boiling point."; |
| 13 | } else if (t==0) { |
| 14 | throw "It reached the freezing point."; |
| 15 | } else { |
| 16 | cout << "the temperature = "<< t << endl; |
| 17 | } |
| 18 | } |
| 19 | catch(int x) { |
| 20 | cout << "temperature=" << x << endl; |
| 21 | } |
| 22 | catch(char const*s) { |
| 23 | cout << s << endl; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | void handler(int n) throw(int, char, double) { |
| 28 | if (n==1) throw n; |