帮忙用C语言写一个梯形矫正的例子
时间: 2023-03-29 21:03:00 浏览: 117
好的,我可以回答这个问题。以下是一个用 C 语言编写的梯形矫正的例子:
```c
#include <stdio.h>
int main() {
float top, bottom, height, area;
printf("请输入梯形的上底、下底和高:\n");
scanf("%f %f %f", &top, &bottom, &height);
area = (top + bottom) * height / 2;
printf("梯形的面积为:%f\n", area);
return ;
}
```
这个程序会要求用户输入梯形的上底、下底和高,然后计算梯形的面积并输出。希望对你有帮助!
阅读全文
相关推荐











