#include
int main()
{
int a, b, h;
printf("Введите a, b, h:\n");
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&h);
printf("a=%d",a);
printf(" b=%d",b);
printf(" h=%d\n",h);
printf("s = %lf\n",(a+b)/2.0*h);
return 0;
}
Пример:
Введите a, b, h:
5
3
2
a=5 b=3 h=2
s = 8.000000