Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Matrix.hpp"
- using namespace std;
- int main()
- {
- try
- {
- Matrix A("dane.txt"), B("dane3.txt"), C("dane2.txt");
- cout<<"A : \n"<<A<<endl;
- cout<<"B : \n"<<B<<endl;
- cout<<"C : \n"<<C<<endl;
- cout<<"A + B : \n"<<A+B<<endl;
- cout<<"A - B : \n"<<A-B<<endl;
- cout<<"A * C : \n"<<A*C<<endl;
- A+=B;
- cout<<"A + B : \n"<<A<<endl;
- A-=B;
- cout<<"A - B : \n"<<A<<endl;
- A*=C;
- cout<<"A * C : \n"<<A<<endl;
- cout<<"A[1][1] = "<<A(1,3)<<endl;
- cout<<"B[2][2] = "<<B(2,2)<<endl;
- }
- catch (wrong_file_name&)
- {
- cout<<"Wrong file name caught!\n\n";
- }
- catch (bad_index&)
- {
- cout<<"Bad index caught!\n\n";
- }
- catch (wrong_size&)
- {
- cout<<"Wrong size caught!\n\n";
- }
- catch (different_sizes&)
- {
- cout<<"Different sizes caught!\n\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement