1 solutions

  • 0
    @ 2025-11-5 19:40:17

    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

    Information

    ID
    19525
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By