struct Rectangle{
float length,width;
};
Rectangle InitRectangle(float len, float wid) {
Rectangle R;
R.length=len;
R.width=wid;
return R;
}
float Circumference(Rectangle R) {
return 2*(R.length+R.width);
}
float Area(Rectangle R) {
return R.length*R.width;
}
#include<stdio.h>
void main()
{
Rectangle t;
float a=1,b=2;
t=InitRectangle(a,b);
printf("%d %d",Circumference(t),Area(t));
}
请问我说在哪个地方了
參考答案:使用
printf("%f %f",Circumference(t),Area(t));