C++课程,要求把宏L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R 改为函数形式C++课程#include #define PI 3.1415926#define CIRCLE(R,L,S,V) L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*Rvoid main(){float r,l,s,v;scanf("%f",&r);CIRCLE(r,l,s,v); printf("r=%6.2f,l
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/04 10:37:27
![C++课程,要求把宏L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R 改为函数形式C++课程#include #define PI 3.1415926#define CIRCLE(R,L,S,V) L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*Rvoid main(){float r,l,s,v;scanf(](/uploads/image/z/12418096-40-6.jpg?t=C%2B%2B%E8%AF%BE%E7%A8%8B%2C%E8%A6%81%E6%B1%82%E6%8A%8A%E5%AE%8FL%3D2%2API%2AR%3BS%3DPI%2AR%2AR%3BV%3D4.0%2F3.0%2API%2AR%2AR%2AR+%E6%94%B9%E4%B8%BA%E5%87%BD%E6%95%B0%E5%BD%A2%E5%BC%8FC%2B%2B%E8%AF%BE%E7%A8%8B%23include+%23define+PI+3.1415926%23define+CIRCLE%28R%2CL%2CS%2CV%29+L%3D2%2API%2AR%3BS%3DPI%2AR%2AR%3BV%3D4.0%2F3.0%2API%2AR%2AR%2ARvoid+main%28%29%7Bfloat+r%2Cl%2Cs%2Cv%3Bscanf%28%22%25f%22%2C%26r%29%3BCIRCLE%28r%2Cl%2Cs%2Cv%29%3B+printf%28%22r%3D%256.2f%2Cl)
C++课程,要求把宏L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R 改为函数形式C++课程#include #define PI 3.1415926#define CIRCLE(R,L,S,V) L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*Rvoid main(){float r,l,s,v;scanf("%f",&r);CIRCLE(r,l,s,v); printf("r=%6.2f,l
C++课程,要求把宏L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R 改为函数形式
C++课程
#include
#define PI 3.1415926
#define CIRCLE(R,L,S,V) L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R
void main()
{float r,l,s,v;
scanf("%f",&r);
CIRCLE(r,l,s,v); printf("r=%6.2f,l=%6.2f,s=%6.2f,v=%6.2f\n",r,l,s,v);
}
要求把宏L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R 改为函数形式
C++课程,要求把宏L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R 改为函数形式C++课程#include #define PI 3.1415926#define CIRCLE(R,L,S,V) L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*Rvoid main(){float r,l,s,v;scanf("%f",&r);CIRCLE(r,l,s,v); printf("r=%6.2f,l
void CIRCLE(float R,float &L,float &S,float &V){L=2*PI*R;S=PI*R*R;V=4.0/3.0*PI*R*R*R;}
替换define那一行