首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> #define f(x) x*x*x main() { int a=3,s,t ; s=f(a+1); t=f((a+1)); printf("%d,%d\n",s,t); } 程序运行后的输出结果是
有以下程序 #include <stdio.h> #define f(x) x*x*x main() { int a=3,s,t ; s=f(a+1); t=f((a+1)); printf("%d,%d\n",s,t); } 程序运行后的输出结果是
admin
2020-07-28
24
问题
有以下程序
#include <stdio.h>
#define f(x) x*x*x
main() {
int a=3,s,t ;
s=f(a+1);
t=f((a+1));
printf("%d,%d\n",s,t); }
程序运行后的输出结果是
选项
A、10,10
B、10,64
C、64,10
D、64,64
答案
B
解析
根据题目中宏f(x)的定义,f(a+1)=a+1*a+1*a+1= a+a+a+1=10,而f((a+1))=(a+1)*(a+1)*(a+1)=4*4*4=64。
转载请注明原文地址:https://kaotiyun.com/show/em3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
在黑盒测试方法中,设计测试用例的主要根据是
在数据库系统中,考虑数据库实现的数据模型是
下列关于数据库设计的叙述中,正确的是
有以下程序#include<stdio.h>main(){inta=0,b=0;/*给a赋值a=10;b=20;给b赋值*/printf("a+b=%d\n",a+b);/*输出计算结果*/}程序运行后的输出结果是
以下不合法的字符常量是
以下叙述中正确的是
有以下程序main(){inta=1,b=2,c=3,d=0;if(a==1&&b++==2)if(b!=2||c--!=3)printf("%d,%d,%d\n",a,b,c);elseprintf("%d,%d,%d\n",
一棵完全二叉树共有360个结点,则在该二叉树中度为1的结点个数为
某系统结构图如下图所示。该系统结构图的最大扇入数是
E-R图中用来表示实体的图形是
随机试题
门静脉高压症的护理应避免
A、色甘酸钠B、二羟丙茶碱C、易咳净D、酮替芬E、二丙酸倍氯米松适用于预防变态反应所致速发型哮喘的药物是
王某面临多起民事纠纷,拟通过诉讼或仲裁的方式解决,但王某对诉讼和仲裁的作用以及两者相互之间的区别联系等不够了解,遂就有关问题进行咨询。请回答下列(1)一(3)题:下列有关仲裁与民事诉讼两者的关系的表述中哪些是正确的?()
沥青表面处置主要起防水层、磨耗层、防滑层或改善碎(砾)石路面的作用,常用厚度为()mm。
有的士兵步枪射击成绩达标了;有的士兵步枪射击成绩没有达标;小方和小李步枪射击成绩达标了。 如果上述三个判断中只有一个符合事实,则以下哪项判断为真?
A、 B、 C、 D、 A这是一道图形位置变化题,仔细观察图形可知每个图形都有一个三角形在线段的端点,由此可排除B、D选项,再分析A、C项,结合图形,我们可以看出右端的三角形为下面的三角形移动的结果,由此可知
A、 B、 C、 D、 C
关于IP数据报的报头,以下哪种说法是错误的()。
Whatis"directed"research?Directedresearchmaybecomeadangertothefutureofsciencebecause______.
TheUnitedNationsImpressiveasthemodernnetworkofinternationalorganizationandeconomicagreementsmayseemonthes
最新回复
(
0
)