Guest User

Untitled

a guest
Nov 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. double dzielenie(double a, double b)
  2. {
  3.     try
  4.     {
  5.         if(b==0)
  6.             throw "Dzielisz przez zero";
  7.             cout << a / b << endl;
  8.     }
  9.     catch (exception xyz)
  10.     {
  11.         cout << xyz.what() << endl;
  12.     }
  13.     catch (int x)
  14.     {
  15.         cout << "Cos z inta" << x << endl;
  16.     }
  17.     catch (...)
  18.     {
  19.         cout << "Totalna masakra " << endl;
  20.     }
  21.    
  22. }
  23.  
  24.  
  25.  
  26. int main()
  27. {
  28.     dzielenie(10,0);
  29.  
  30.     system("pause");
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment