#define p(x) x*x int x=5,y=3,z; z=p(x+y); A) 64 B) 23 C) 46 D) 32
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 02:51:20
#definep(x)x*xintx=5,y=3,z;z=p(x+y);A)64B)23C)46D)32#definep(x)x*xintx=5,y=3,z;z=p(x+y);A)64B)23C)46
#define p(x) x*x int x=5,y=3,z; z=p(x+y); A) 64 B) 23 C) 46 D) 32
#define p(x) x*x int x=5,y=3,z; z=p(x+y); A) 64 B) 23 C) 46 D) 32
#define p(x) x*x int x=5,y=3,z; z=p(x+y); A) 64 B) 23 C) 46 D) 32
选B.
这样做的.结果是这样出来的.5+3*5+3 = 23.
因为宏定义只是简单的替换的.直接替换掉X的值得.所以得出来的结果就是上面的那样的结果的.
#define P 3 void F(int x){return(P*x*x);} main() {printf(%d
,F(3+5));}
#define P3 void F(int x){return(P*x*x);} main() {printf(%d
,F(3+5));}
#define p(x) x*x int x=5,y=3,z; z=p(x+y); A) 64 B) 23 C) 46 D) 32
若有宏定义# define s(x) x*x-x,设int k=3; 问cout
#define X 3 #define Y X*2 #undef X #define X 2 int z=Y; z 的值为多少?
#define MA(x) x*x-1 int a=1,b=2; cout
#define s(x) 3
#define S(x) 3
define fun(x,
#define configASSERT( x )
#define min(x,y) (x
#define MIN(x,y)(x)
#define __T(x) L ## x
#define get2byte(x) ((x)[0]
若有定义∶# define P(x) x * x *x+1和说明语句:int a=2;则表达式P(2)的值是( )具体说说程序正义运行,
#define N 10#define s(x) x*x#define f(x) (x*x)main(){int i1,i2;i1=1000/s(N);i2=1000/f(N);printf(%d %d
,i1,i2);}运行结果是?
求此题解题过程:#include #define N 8 void fun(int *x,int i) {*x=*(x+i);} main() {int a[N]
#define f(x) x*x main( ) { int i; i=f(4+4)/f(2+2); printf(%d
,i); }