Problem: 2001 ( 计算两点间的距离 )

发布时间:2020-01-13 13:04:22 作者:ranyue 阅读量:101

#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
#include <math.h>
#include <cstdio>
#include <iomanip>
#include<bits/stdc++.h>

using namespace std; 


int main()
{
    
    double x1, x2, y1, y2;
    while (cin >> x1 >> y1 >> x2 >> y2)
    {
        double distance = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
        cout << fixed << setprecision(2);
        cout << distance << endl;

    }

    return 0;
    //system("pause");
    
}

我要评论 登录后才能发布评论

复试练习

ranyue(染月)   我要留言
Catfish(鲶鱼) CMS V 6.2.6