#include <iostream>
#include <string>
using namespace std;
int main(){
for (int i = 0; i < 5; i++) {
try {
switch(i) {
case 0 : throw i ; break;
case 1 : throw string("1.0000"); break;
case 2 : throw 2.1 ; break;
case 3 : throw i ; break;
case 4 : throw string("4.0000"); break;
default: break;
}
}
catch (int except) { cout << except << " int型の例外発生" << endl; }
catch (string except) { cout << except << " string型の例外発生" << endl; }
catch (double except) { cout << except << " double型の例外発生" << endl; }
}
return 0;
}