#include <iostream>
#include <math.h>
using namespace std;
float laenge(int x1, int y1, int x2, int y2) {
int distx;
int disty;
if (x1>=x2) distx= x1-x2;
else distx= x2-x1;
if (y1>=y2) disty= y1-y2;
else disty= y2-y1;
return (sqrt((float) (distx*distx)+(float) (disty*disty)));
}
float test_laenge ( int x1, int y1, int x2, int y2) {
cout << "X_1 = " << x1 << " Y_1 = " << y1 << "\n";
cout << "X_2 = " << x2 << " Y_2 = " << y2 << "\n";
cout << "Laenge: " << laenge(x1,y1,x2,y2) << "\n\n";
return 0;
}
int main () {
test_laenge (0,0,12,5);
test_laenge (-12,-2,-1,0);
test_laenge (-4,3,8,8);
test_laenge (8,11,-7,-10);
test_laenge (8,11,8,11);
return 0;
}