Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int main()
- {
- int xa,xb,ya,yb;
- cout<<"Podaj liczbe xa,ya,xb,yb"<<endl;
- cout<<"xa="; cin>>xa;
- cout<<"ya="; cin>>ya;
- cout<<"xb="; cin>>xb;
- cout<<"yb="; cin>>yb;
- float x=sqrt(pow(xb-xa,2)+(pow(yb-ya,2)));
- cout<<"AB="<<x<<endl;
- int xp,yp;
- xp=3;
- yp=4;
- float q=sqrt(pow(xa-xp,2)+(pow(ya-yp,2)));
- cout<<"AP="<<q<<endl;
- float w=sqrt(pow(xb-xp,2)+(pow(yb-yp,2)));
- cout<<"PB="<<w<<endl;
- if(x=q+w)
- {
- cout<<"Nalezy"<<endl;
- }
- else
- {
- cout<<"nienalezy"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement