编写程序,从键盘输入一个矩形的长度和宽度,输出面积和周长。
【参考答案】
void main
{
float len,wid,size;/*len,wid,size分别表示矩形的长、宽、面积*/
printf("input length:");
scanf("%f",&len);
printf("input width:");
scanf("%f",&wid);
size=len*wid;
printf("size of the rectangle is: %f\n", size);
}
【参考答案】
void main
{
float len,wid,size;/*len,wid,size分别表示矩形的长、宽、面积*/
printf("input length:");
scanf("%f",&len);
printf("input width:");
scanf("%f",&wid);
size=len*wid;
printf("size of the rectangle is: %f\n", size);
}
参考答案:
参考解析:正在整理中,欢迎在文下评论区提供答案解析,谢谢!