Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double distance_from_point1_to_point2(double u, double v, double w, double z)
- {
- return sqrt(pow((abs(u - w)), 2) + pow((abs(v - z)), 2));
- }
- int main()
- {
- setlocale(LC_ALL, "ru");
- double masiveX[10]{ 0.5, 0.99, 31, 0.24, 0.55, 1, 0.33, 8, 9, 10 };
- double masiveY[10]{ 0.33, 0.6, 3, 0.55, 0.99, 23, 1, 8, 4, 4 };
- cout << "Точки ,принадлежащие первой четверти : " << endl;
- int i = 0;
- for ( i ; i < 10; i++)
- {
- if (masiveX[i] >= 0 && masiveY[i] >= 0 && ((distance_from_point1_to_point2(0, 0, masiveX[i], masiveY[i])) <= 1))
- {
- cout << "X = " << masiveX[i] << " "<< "Y = " << masiveY[i]<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement