2 条题解

  • 1
    @ 2025-1-19 17:37:49

    #include <bits/stdc++.h> using namespace std;

    int main(){ int a1,a2,n,cha,an; cin>>a1>>a2>>n; cha=a2-a1; an=a1+(n-1)*cha; cout<<an; return 0; } 简便方法来啦!

  • 1
    @ 2025-1-18 21:16:41
    #include <stdio.h>
    #include <math.h>
    int main()
    {
        double x1,x2,y1,y2,x3,y3;
        double a,b,c,p;
        scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
        a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
        c=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
        p=1.0/2.0*(a+b+c);
        printf("%.2lf\n",sqrt(p*(p-a)*(p-b)*(p-c)));
        return 0;
    }
    
    
  • 1

信息

ID
36
时间
1000ms
内存
128MiB
难度
3
标签
(无)
递交数
102
已通过
57
上传者