Zadania z dziś

This commit is contained in:
2022-11-09 17:10:49 +01:00
parent 4f1dff7e51
commit 095e7c102c
5 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#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;
}