QWQ!!!

P5735 【深基7.例1】距离函数

lzbyyds @ 2023-12-19 16:52:37

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int x1, x2, x3, y1, y2, y3;
    scanf("%d %d", &x1, &y1);
    scanf("%d %d", &x2, &y2);
    scanf("%d %d", &x3, &y3);
    double dis1, dis2, dis3;
    dis1 = sqrt(abs(x1 - x2) * abs(x1 - x2) + abs(y1 - y2) * abs(y1 - y2));
    dis2 = sqrt(abs(x3 - x2) * abs(x3 - x2) + abs(y3 - y2) * abs(y3 - y2));
    dis3 = sqrt(abs(x1 - x3) * abs(x1 - x3) + abs(y1 - y3) * abs(y1 - y3));
    double sum = dis1 + dis2 + dis3;
    return 0;
}

by zjy20110816 @ 2023-12-19 17:26:08

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double x1, x2, x3, y1, y2, y3;
    scanf("%d %d", &x1, &y1);
    scanf("%d %d", &x2, &y2);
    scanf("%d %d", &x3, &y3);
    double dis1, dis2, dis3;
    dis1 = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    dis2 = sqrt((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2));
    dis3 = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
    double sum = dis1 + dis2 + dis3;
  printf("%.2lf",sum);
    return 0;
}

没认真听讲,扣5000000000000分!!!


by lzbyyds @ 2023-12-19 17:27:54

@zjy20110816 你才没认真听讲,不过——谢谢??/


by HEROBRINEH @ 2024-01-06 16:02:33

@zjy20110816 有没有一种可能,你的AC不了


by wrup_AC_28 @ 2024-01-30 21:31:24

@zjy20110816 蚌埠了你这玩意满江红


by Abelxxyy @ 2024-02-22 09:32:59

@zjy20110816 , double%lf输入。


by zjy20110816 @ 2024-02-22 19:25:14

@Abelxy 不好意思,没注意


|