Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <cmath>
  4. #include <math.h>
  5. using namespace std;
  6. int main()
  7. {
  8. int xa,xb,ya,yb;
  9.  
  10. cout<<"Podaj liczbe xa,ya,xb,yb"<<endl;
  11. cout<<"xa="; cin>>xa;
  12. cout<<"ya="; cin>>ya;
  13. cout<<"xb="; cin>>xb;
  14. cout<<"yb="; cin>>yb;
  15. float x=sqrt(pow(xb-xa,2)+(pow(yb-ya,2)));
  16. cout<<"AB="<<x<<endl;
  17. int xp,yp;
  18. xp=3;
  19. yp=4;
  20. float q=sqrt(pow(xa-xp,2)+(pow(ya-yp,2)));
  21. cout<<"AP="<<q<<endl;
  22. float w=sqrt(pow(xb-xp,2)+(pow(yb-yp,2)));
  23. cout<<"PB="<<w<<endl;
  24.  
  25. if(x=q+w)
  26. {
  27. cout<<"Nalezy"<<endl;
  28. }
  29. else
  30. {
  31. cout<<"nienalezy"<<endl;
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement