问题
单项选择题
下列程序的输出结果是( )。 #include<stdio.h> #define F(x)2.84+x #define w(y)printf("%d",(int)(y)) #define P(y)w(y)putchar('\n') main() { int x=2; P(F(5) *x); }
A.12
B.13
C.14
D.16
答案
参考答案:A
解析: 本题考查带参数的宏的定义及相关运算。P(P(5)*x)=P(2.84+5*2)=P(12.84),调用w(12.84),输出 (int)(12.84)=12。