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,2)-pow(xa,2))+(pow(yb,2)-pow(ya,2)));
- cout<<"AB="<<x<<endl;
- int xp,yp;
- xp=3;
- yp=4;
- float q=sqrt((pow(xa,2)-pow(xp,2))+(pow(ya,2)-pow(yp,2)));
- cout<<"AP="<<q<<endl;
- float w=sqrt((pow(xb,2)-pow(xp,2))+(pow(yb,2)-pow(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