30 lines
No EOL
588 B
C++
30 lines
No EOL
588 B
C++
#include <cstdio>
|
|
#include <cstdlib>
|
|
#include <iostream>
|
|
#include <cstring>
|
|
#include <list>
|
|
#include <set>
|
|
#include <unordered_map>
|
|
#include <time.h>
|
|
#include <math.h>
|
|
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
int wait_time = 46;
|
|
try
|
|
{
|
|
cout << "Try block entered.\n";
|
|
if (wait_time > 30)
|
|
throw wait_time;
|
|
cout << "Leaving try block.\n";
|
|
}
|
|
catch (int thrown_value)
|
|
{
|
|
cout << "Exception thrown with\n"
|
|
<< "wait_time equal to " << thrown_value << endl;
|
|
}
|
|
cout << "After catch block." << endl;
|
|
return 0;
|
|
} |