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/11/15 18:34:59
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那一行