帮我编C语言,从键盘输入矩形的长和宽,计算矩形的周长和面积.

问题描述:

帮我编C语言,从键盘输入矩形的长和宽,计算矩形的周长和面积.

#include
int main()
{
double width;
double height;
printf("请输入矩形的长:");
scanf("%lf%*c",&height);
printf("请输入矩形的宽:");
scanf("%lf%*c",&width);
printf("矩形周长:%lf\n",2 * (height + width));
printf("矩形面积:%lf\n",height * width);
return 0;
}