1 条题解

  • 0
    @ 2024-9-3 22:03:14

    C :

    #include<stdio.h>
    
    int main(int argc , char** argv)
    {
    	double s,h,a,b;
    	scanf ("%lf%lf%lf",&h,&a,&b);
    	s=(a+b)*h/2.0;
    	printf ("%.2f" , s);
    	return 0;
    }
    

    C++ :

    #include<iostream>
    #include<cstdio>
    using namespace std;
    int main()
    {
    	float s,h,a,b;
    	cin>>h>>a>>b;
    	s=h*(a+b)/2;
    	printf("%.2f",s);
    	return 0;
    }
    

    Pascal :

    program xx;
    var h,a,b:integer;
        s:real;
    begin
    readln(h);
    readln(a,b);
    s:=1/2*h*(a+b);
    writeln(s:3:2);
    end.
    
    • 1

    信息

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