Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include "Matrix.hpp"
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. try
  8. {
  9. Matrix A("dane.txt"), B("dane3.txt"), C("dane2.txt");
  10. cout<<"A : \n"<<A<<endl;
  11. cout<<"B : \n"<<B<<endl;
  12. cout<<"C : \n"<<C<<endl;
  13. cout<<"A + B : \n"<<A+B<<endl;
  14. cout<<"A - B : \n"<<A-B<<endl;
  15. cout<<"A * C : \n"<<A*C<<endl;
  16. A+=B;
  17. cout<<"A + B : \n"<<A<<endl;
  18. A-=B;
  19. cout<<"A - B : \n"<<A<<endl;
  20. A*=C;
  21. cout<<"A * C : \n"<<A<<endl;
  22. cout<<"A[1][1] = "<<A(1,3)<<endl;
  23. cout<<"B[2][2] = "<<B(2,2)<<endl;
  24. }
  25. catch (wrong_file_name&)
  26. {
  27. cout<<"Wrong file name caught!\n\n";
  28. }
  29. catch (bad_index&)
  30. {
  31. cout<<"Bad index caught!\n\n";
  32. }
  33. catch (wrong_size&)
  34. {
  35. cout<<"Wrong size caught!\n\n";
  36. }
  37. catch (different_sizes&)
  38. {
  39. cout<<"Different sizes caught!\n\n";
  40. }
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement