如题所述
第1个回答 2014-10-12
#include<math.h>
#include<stdio.h>
int main(void)
{
//上底 下底 高
double top, bottom, high;
scanf("%lf %lf %lf", &top, &bottom, &high);
double S = ((top + bottom) * high) / 2.0;
printf("%.2f\n", S);
}本回答被提问者和网友采纳
#include<stdio.h>
int main(void)
{
//上底 下底 高
double top, bottom, high;
scanf("%lf %lf %lf", &top, &bottom, &high);
double S = ((top + bottom) * high) / 2.0;
printf("%.2f\n", S);
}本回答被提问者和网友采纳
第2个回答 2014-10-12
用两个for语句就可以了,跟做三角形的方法类似