结构体

#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
struct piont
{
    double x,y;
};
double dist(struct piont a,struct piont b)
{
    return hypot(a.x-b.x,a.y-b.y);
}

int main()
{
    struct piont a,b;
    scanf("%lf%lf%lf%lf",&a.x,&a.y,&b.x,&b.y);
    printf("%lf\n",dist(a,b));
    return 0;
}

hypot()

struct

posted @ 2016-02-18 15:07  邻家那小孩儿  阅读(107)  评论(0编辑  收藏  举报