Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- #define MAXX 1001
- #define SCALAR 0.4
- using namespace std;
- double** DIFFERENCE(double **p, double **p2, int m, int n)
- {
- double s = new(nothrow)int*[m];
- for (int i = 0; i < m; ++i)
- s[i] = new(nothrow)int[n];
- for (int i = 0; i < m; ++i)
- for (int j = 0; j < n; ++j)
- s[i][j] = p[i][j] - p2[i][j];
- return s;
- }
- int main()
- {
- int m, n;
- cin >> m >> n;
- double** mat1 = READ(m, n);
- int m2, n2;
- cin >> m2 >> n2;
- double** mat2 = READ(m2, n2);
- int m3, n3;
- double** mat3 = DIFFERENCE(mat1, mat2, m, n);
- SHOW_MATRIX(mat3, m, n);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement