#include <stdio.h>
#include <math.h>
int main() {
double upper, lower, height;
double waist;
double perimeter;
printf("请输入等腰梯形的上底,下底和高:");
scanf("%lf%lf%lf", &upper, &lower, &height);
waist = sqrt(pow(height, 2) + pow((lower - upper) / 2, 2));
perimeter = upper + lower + 2 * waist;
printf("等腰梯形的周长为:%.2lf\n", perimeter);
return 0;
}
#include <math.h>
int main() {
double upper, lower, height;
double waist;
double perimeter;
printf("请输入等腰梯形的上底,下底和高:");
scanf("%lf%lf%lf", &upper, &lower, &height);
waist = sqrt(pow(height, 2) + pow((lower - upper) / 2, 2));
perimeter = upper + lower + 2 * waist;
printf("等腰梯形的周长为:%.2lf\n", perimeter);
return 0;
}