2 条题解

  • 0
    @ 2024-10-15 8:41:13

    #include <stdio.h>

    #include <math.h>

    int main()

    {

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++){

    double x1,y1,x2,y2;

    scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);

    double a=sqrt((x1-x2)(x1-x2)+(y1-y2)(y1-y2));

    printf("%.2lf\n",a);

    }

    return 0;

    }

    • 0
      @ 2023-10-9 1:42:32
      #include<stdio.h>
      #include<math.h>
      int main()
      {
          int n;
          scanf("%d",&n);
          while(n--)
          {
              double x1,y1,x2,y2;
              double dist;
              scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
              dist=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
               printf("%.2lf\n",dist);
          }
          return 0;
      }
      
      • 1

      信息

      ID
      164
      时间
      3000ms
      内存
      128MiB
      难度
      7
      标签
      (无)
      递交数
      1088
      已通过
      290
      上传者