14 lines
341 B
C++
14 lines
341 B
C++
#include <iostream>
|
|
#include <cmath>
|
|
|
|
double odleglosc(double xa, double ya, double xb, double yb)
|
|
{
|
|
return std::sqrt(std::pow(xa-xb, 2)+std::pow(ya-yb, 2));
|
|
}
|
|
int main(int argc, char *argv[])
|
|
{
|
|
std::cout << odleglosc(1,1,2,1) << std::endl;
|
|
std::cout << odleglosc(1,1,2,2) << std::endl;
|
|
std::cout << odleglosc(1,1,-2,21) << std::endl;
|
|
}
|