Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "library.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- ifstream file1("input.txt");
- ofstream file2("output.txt");
- ifstream file3("input2.txt");
- int rows, cols;
- file1 >> rows >> cols;
- SparseMatrix A(rows, cols);
- A.Read(file1);
- A.Print(file2);
- file3 >> rows >> cols;
- SparseMatrix B(rows, cols);
- file2 << endl;
- B.Read(file3);
- B.Print(file2);
- file2 << "SUM" << endl;
- A += B;
- A.Print(file2);
- file2 << "DIF" << endl;
- A -= B;
- A.Print(file2);
- file2 << "Const" << endl;
- double n = 3;
- A *= n;
- A.Print(file2);
- file2 << "Mul" << endl;
- A *= B;
- A.Print(file2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement