Advertisement
Korotkodul

exp

Dec 17th, 2024
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <vector>
  6. #include <sstream>
  7.  
  8. class DivisionByZero{};
  9.  
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14.     int a, b;
  15.     try {
  16.         if(b == 0) {
  17.             throw DivisionByZero();
  18.         }
  19.        
  20.     }
  21.     catch(DivisionByZero x) {
  22.         cout << "" << "\n";
  23.     }
  24.     catch(...) {
  25.        
  26.     }
  27.     cout << "\n";
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement