1 solutions
-
0
C :
#include<stdio.h> int main() {float a,b,h,s; scanf("%f%f%f",&a,&b,&h); s=(a+b)*h/2; printf("%.2f",s); return 0; }C++ :
#include<cstdio> #include<iostream> using namespace std; int main() { float a,b,h,s; cin>>a>>b>>h; s=(a+b)*h/2; printf("%0.2f\n",s); return 0; }Pascal :
var a,b,c:extended; begin readln(a,b,c); writeln(((a+b)*c)/2:0:2); end.Python :
a,b,c = raw_input().split() a = float(a) b = float(b) c = float(c) print "%.2f" % (((a + b) * c) / 2.0)
- 1
Information
- ID
- 20007
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By