#include <stdio.h>
#include <math.h>
struct Coordinate{
double x;
double y;
double z;
};
int main(void)
{
struct Coordinate a={1,5,2};
struct Coordinate b={5,3,1};
struct Coordinate c={2,8,4};
double length_ab;
double length_co;
length_ab
=sqrt((b.
x-a.
x)*(b.
x-a.
x)+(b.
y-a.
y)*(b.
y-a.
y)+(b.
z-a.
z)*(b.
z-a.
z));length_co
=sqrt(c.
x*c.
x+c.
y*c.
y+c.
z*c.
z);
if(length_ab>length_co){
printf("length ab :%lf\n",length_ab
); }
else{
printf("length co :%lf\n",length_co
); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgpzdHJ1Y3QgQ29vcmRpbmF0ZXsKZG91YmxlIHg7CmRvdWJsZSB5Owpkb3VibGUgejsKfTsKCmludCBtYWluKHZvaWQpCnsKc3RydWN0IENvb3JkaW5hdGUgYT17MSw1LDJ9OwpzdHJ1Y3QgQ29vcmRpbmF0ZSBiPXs1LDMsMX07CnN0cnVjdCBDb29yZGluYXRlIGM9ezIsOCw0fTsKCmRvdWJsZSBsZW5ndGhfYWI7CmRvdWJsZSBsZW5ndGhfY287CgpsZW5ndGhfYWI9c3FydCgoYi54LWEueCkqKGIueC1hLngpKyhiLnktYS55KSooYi55LWEueSkrKGIuei1hLnopKihiLnotYS56KSk7Cmxlbmd0aF9jbz1zcXJ0KGMueCpjLngrYy55KmMueStjLnoqYy56KTsKCmlmKGxlbmd0aF9hYj5sZW5ndGhfY28pewpwcmludGYoImxlbmd0aCBhYiA6JWxmXG4iLGxlbmd0aF9hYik7Cn0KZWxzZXsKcHJpbnRmKCJsZW5ndGggY28gOiVsZlxuIixsZW5ndGhfY28pOwp9CglyZXR1cm4gMDsKfQo=