#include
void main()
{ float l,w;
float area,girth;
printf("please input length and width of the rectangle\n");
scanf("%f%f",&l,&w);
area=(l*w);
girth=(2*(l+w));
printf("area=%f,girth=%f\n",area,girth);
}
#include
main()
{
int chang,int kuang;
int zhouchang,mianji;
printf("please Enter chang and kuang:");
scanf("%d,%d",&chang,&kuang);
zhouchang=2*(chang+kuang);
mianji=chang*kuang;
printf("zhouchang=%d\n,mianji=%d\n",zhouchang,mianji);
}
说明:输入长和宽中间用空格隔开
用java编写一个 很简单啊