问题 填空题

下面程序的运行结果是 【8】  【9】 。    #include<iostream.h>
   #define N 10
    #define s(x)x * x
    #define f(x)(x * x)
    void main( )
     int i1,i2;
     i1=1000/s(N);i2=1000/f(N);
     cout < < i1 < < " " < < i2;

答案

参考答案:【8】1000
【9】10

解析:解析:对于define宏定义语句,系统会在编译前进行替换。本题替换过程如下:
i1=1000/s(N)
i1=1000/s(10)
i1=1000/10*10
i1=1000
i2=1000/f(N)
i2=1000/f(10)1
i2=1000/(10*10)
i2=10

单项选择题
选择题