Advertisement
Artem771577

kr

Nov 19th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5.  
  6. double distance_from_point1_to_point2(double u, double v, double w, double z)
  7. {
  8.  
  9. return sqrt(pow((abs(u - w)), 2) + pow((abs(v - z)), 2));
  10.  
  11. }
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. int main()
  19. {
  20. setlocale(LC_ALL, "ru");
  21. double masiveX[10]{ 0.5, 0.99, 31, 0.24, 0.55, 1, 0.33, 8, 9, 10 };
  22. double masiveY[10]{ 0.33, 0.6, 3, 0.55, 0.99, 23, 1, 8, 4, 4 };
  23.  
  24. cout << "Точки ,принадлежащие первой четверти : " << endl;
  25. int i = 0;
  26. for ( i ; i < 10; i++)
  27. {
  28. if (masiveX[i] >= 0 && masiveY[i] >= 0 && ((distance_from_point1_to_point2(0, 0, masiveX[i], masiveY[i])) <= 1))
  29. {
  30. cout << "X = " << masiveX[i] << " "<< "Y = " << masiveY[i]<<endl;
  31. }
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement