November 2018 1 4 Report

#include <iostream>
#include <cmath>
using namespace std;
double odlegloscR(int xp,int yp,int xs,int ys)
{
int r;
r=sqrt(pow(xp-xs,2)+pow(yp-ys,2));
return r;
}
int odlegloscTS(int xt,int yt,int xs,int ys)
{
int a;
a=sqrt((pow(xt-xs,2)+pow(yt-ys,2)));
return a;
}
bool nalezy(int xp,int yp,int xs,int ys,int xt,int yt)
{
if(odlegloscR(xp,yp,xs,ys)>=odlegloscTS(xt,yt,xs,ys))
return true;
else
return false;
}
int main()
{
int xt,yt,xs, ys, xp, yp;
cout<<"podaj 1 wspolrzedna punktu T";
cin>>xt;
cout<<"podaj 2 wspolrzedna punktu T";
cin>>yt;
cout<<"podaj 1 wspolrzdna punktu P";
cin>>xp;
cout<<"podaj 2 wspolrzedna punktu P";
cin>>yp;
cout<<"podaj 1 wspolrzedna punktu S";
cin>>xs;
cout<<"podaj 2 wspolrzedna punktu S";
cin>>ys;
nalezy(xp,yp,xs,ys,xt,yt);
cout<<endl;
system("pause");
return 0;
}

jakie są błędy ??


Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.