SHARE
TWEET

Untitled

a guest Oct 16th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<math.h>
  3. #define MAXX 1001
  4. #define SCALAR 0.4
  5.  
  6. using namespace std;
  7.  
  8. double** DIFFERENCE(double **p, double **p2, int m, int n)
  9. {  
  10.     double s = new(nothrow)int*[m];
  11.     for (int i = 0; i < m; ++i)
  12.         s[i] = new(nothrow)int[n];
  13.     for (int i = 0; i < m; ++i)
  14.         for (int j = 0; j < n; ++j)
  15.             s[i][j] = p[i][j] - p2[i][j];
  16.     return s;
  17. }
  18.  
  19. int main()
  20.  
  21. {
  22.  
  23.     int m, n;
  24.     cin >> m >> n;
  25.     double** mat1 = READ(m, n);
  26.     int m2, n2;
  27.     cin >> m2 >> n2;
  28.     double** mat2 = READ(m2, n2);
  29.     int m3, n3;
  30.     double** mat3 = DIFFERENCE(mat1, mat2, m, n);
  31.     SHOW_MATRIX(mat3, m, n);
  32.    
  33.     system("pause");
  34.     return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top