已知下面的程序段,正确的判断是______。 #define A 3 #define B(A) ((A+1)*a) int a=3; ...... X=3*(A+B(7));
A.程序错误,不允许嵌套定义
B.X=93
C.X=81
D.程序错误,宏定义不允许有参数
第1题:
已知下面的程序段,正确的判断是______ #define A3 #define B(A) ((A+1)*a) X=3*(A+B(7)); X=3*(A+B(7);
A.程序错误,不允许嵌套定义
B.X=93
C.X=81
D.程序错误,宏定义不允许有参数
第2题:
18、已知一个运算被定义为(define (firstCalc x) (* x x)),在其基础上进一步定义新运算secondCalc为x2+y2+z2,下列运算组合式书写正确的是_____。
A.(define secondCalc ((firstCalc x) (firstCalc y) (firstCalc z)))
B.(define (secondCalc x y z) (firstCalc x y z))
C.(define (secondCalc x y z) ((firstCalc x) (firstCalc y) (firstCalc z)))
D.(define secondCalc x y z ((firstCalc x) (firstCalc y) (firstCalc z)))
第3题:
【单选题】对下面程序段: #define A 3 #define B(a) ((A+1)*a) „ x=3*(A+B(7)); 正确的判断是()。
A.程序错误,不许嵌套宏定义
B.x=93
C.x=21
D.程序错误,宏定义不许有参数
第4题:
在C程序中如果要使用数学函数,如sqrt(x),pow(x,y)等,需要在程序中加入的语句是______
A.#define <math.h>
B.#define <stdio.h>
C.#include <stdio.h>
D.#include <math.h>
第5题:
define能作简单的替代,用宏替代计算多项式4*x*x+3*x+2之值的函数f,正确的宏定义是()。
A.#define f (x) 4*x*x+3*x+2
B.#define f 4*x*x+3*x+2
C.#define f(a) (4*a*a+3*a+2)
D.#define (4*a*a+3*a+2) f(a)