天天看點

AcWing 616. 兩點間的距離AcWing 616. 兩點間的距離AC代碼

文章目錄

  • AcWing 616. 兩點間的距離
  • AC代碼

AcWing 616. 兩點間的距離

本題連結:AcWing 616. 兩點間的距離

本部落格給出本題截圖:

AcWing 616. 兩點間的距離AcWing 616. 兩點間的距離AC代碼

AC代碼

代碼:

#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
    double x1, y1, x2, y2;
    scanf("%lf%lf", &x1, &y1);
    scanf("%lf%lf", &x2, &y2);
    printf("%.4lf\n", sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));

    return 0;
}
           

繼續閱讀