结构体
#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
你若是天才,我便是疯子