SHARE
TWEET

1212

a guest Dec 6th, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     double arr[2][2];
  8.     double p1 = 0;
  9.     double p2 = 0;
  10.     double q1 = 0;
  11.     double q2 = 0;
  12.     double v = 0;
  13.    
  14.     for (int i = 0; i < 2; i++)
  15.     {
  16.         for (int j = 0; j < 2; j++)
  17.         {
  18.             cin >> arr[i][j];
  19.         }
  20.     }
  21.  
  22.     p1 = (arr[1][1] - arr[1][0]) / (arr[0][0] + arr[1][1] - arr[0][1] - arr[1][0]);
  23.     p2 = (arr[0][0] - arr[0][1]) / (arr[0][0] + arr[1][1] - arr[0][1] - arr[1][0]);
  24.     q1 = (arr[1][1] - arr[0][1]) / (arr[0][0] + arr[1][1] - arr[0][1] - arr[1][0]);
  25.     q2 = (arr[0][0] - arr[1][0]) / (arr[0][0] + arr[1][1] - arr[0][1] - arr[1][0]);
  26.     v = (arr[1][1] * arr[0][0] - arr[0][1] * arr[1][0]) / (arr[0][0] + arr[1][1] - arr[0][1] - arr[1][0]);
  27.  
  28.     cout << "p1 = " << p1 << " p2 = " << p2 << endl;
  29.     cout << "q1 = " << q1 << " q2 = " << q2 << endl;
  30.     cout << "v = " << v << endl;
  31. }
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
 
Top