首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面程序的运行结果是 1______和 2______。 #include #define N 10 #define s(x)x*x #define f(x)(x*x) void main() { int i1,i2; i1
下面程序的运行结果是 1______和 2______。 #include #define N 10 #define s(x)x*x #define f(x)(x*x) void main() { int i1,i2; i1
admin
2012-09-11
27
问题
下面程序的运行结果是 1______和 2______。
#include
#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;
}
2______。
选项
答案
关系表达式0<20为真,所以表达式!a。
解析
对于define宏定义语句,系统会在编译前进行替换。本题替换过程如下:
i1=1000/s(N)
i1=1000/s(10)
i1=1000/10*10
i1=1000
i2=1000/f(N)
i2=1000/f(10)
i2=1000/(10*10)
i2=10
转载请注明原文地址:https://jikaoti.com/ti/EhL0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
程序调试的任务是()。
若有定义语句:doublea,*p=&a;以下叙述中错误的是
有以下程序:#include<stdio.h>doublefun(doublea){doublex;x=a-(int)a;returnx;}main(){doublea=3.1415:printf("%f\n",fun(a)
在关系代数运算中,有5种基本运算,它们是()。
已知char**s,下面正确的语句是()。
以下选项中非法的字符常量是()。
设变量n已正确定义并赋值,以下不能实现自然数1到n累加求和的程序段是()。
若有定义:intx[10],*pt=x;,则对x数组元素的正确引用是()。
给定程序中,已建立一个带有头结点的单向链表,链表中的各结点包含数据域(data)和指针域(next),数据域为整型。函数fun的作用是:找出链表各结点数据域中的最大值,其最大值由函数值返回。 请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确
随机试题
出让土地使用权的规定有()。
不明原因的哮喘发作,宜选择
A.窄谱抗生素B.广谱抗生素C.抑菌性抗生素D.杀菌性抗生素E.联合应用抗生素混合感染时选用
在教学医院中实习的本科生、研究生、博士生以及毕业第一年的医学生可以在执业医师的指导下,单独从事医师执业的临床工作。()
(2005年)己知图示等直杆的轴力图(N图),则该杆相应的荷载图如()所示。(图中集中荷载单位均为kN,分布荷载单位均为kN/m)
某路桥工程公司通过投标获得了某市一高速公路工程的施工,该公路竣工后,进行了工程质量统计与分析,为今后的施工提供了可借鉴的信息。[问题]公路工程质量评定等级有哪几级?采用什么指标评定等级?
牧童骑黄牛,歌声振林樾。_________,_________。(清.袁枚《所见》)
管理的两重性是指()。
对于一个B类IP地址,网络号为129.250.0.0。如果将其分配给一个单位所用,单位内有3000台机器,分布在15个不同的地点。如选用子网掩码为255.255.255.0,设计整个网络的IP地址分配方案,并给出每个子网的IP地址表示范围。
根据下图所示网络结构回答下列问题。如果该网络内服务器群的IP地址为10.10.33.11-10.10.33.25,并且采用一种设备能够对服务器提供如下保护措施:发送到服务器群的数据包将被进行过滤检测,如果检测到恶意数据包时,系统发出警报并阻断攻击。这
最新回复
(
0
)