首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include int fun(int x){ int p; if(x==0 ‖ x==1)return(3); p=x-fun(x-2);return(p);} main(){
有以下程序 #include int fun(int x){ int p; if(x==0 ‖ x==1)return(3); p=x-fun(x-2);return(p);} main(){
admin
2020-11-23
24
问题
有以下程序
#include
int fun(int x){
int p;
if(x==0 ‖ x==1)return(3);
p=x-fun(x-2);return(p);}
main(){
printf("%d\n",fun(9));
}
程序运行后的输出结果是
选项
A、5
B、9
C、4
D、7
答案
D
解析
函数fun的主要功能是:
初值x的值为9,因此fun(9)=9.fun(7)=9-(7-(5-(3-3))),因此答案为7。
转载请注明原文地址:https://kaotiyun.com/show/6y3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
表达式(int)((double)9/2)-9%2的值是()。
下面选项中不是关系数据库基本特征的是()。
若有代数式(其中e仅代表自然对数的底数,不是变量),则以下能够正确表示该代数式的C语言表达式是()。
设文件指针fp已定义,执行语句fp=fopen(’’file’’,’’w’’);后,下列针对文本文件file操作叙述的选项中正确的是()。
有以下结构体说明、变量定义和赋值语句:structSTD{charname[10];intage;charsex;}s[5],*ps;ps=&s[0];则下列scanf函数调用语句有错误的是()。
深度为7的二叉树共有127个节点,则下列说法中错误的是()。-
设循环队列的存储空间为Q(1:50),初始状态为front=rear=50。现经过一系列入队与退队操作后,front=rear=1,此后又正常地插入了两个元素。最后该队列中的元素个数为()。
以下关于C语言数据类型使用的叙述中错误的是()。
给定程序中,函数fun的功能是:求ss所指字符串数组中长度最短的字符串所在的行下标,作为函数值返回,并把其串长放在形参n所指变量中。ss所指字符串数组中共有M个字符串,且串长<N。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结
下列与队列结构有关联的是
随机试题
女性患者,28岁,妊娠6个月,尿频、尿急、尿痛,伴肉眼血尿2天,体温38.7℃,右肾区叩痛(+),尿常规可见红、白细胞满布视野,首先应考虑的诊断是
张某与刘某夫妻关系不合,在某区人民法院诉讼离婚,一审法院判决可以离婚。被告不服,上诉至某市中级人民法院,二审法院认为夫妻关系确已破裂,因此依旧支持其离婚。此种情况下,二审法院应该如何处理?()
政府对安全生产监督管理的职权是由法律法规所规定,以()为主体实施的,对生产经营单位履行安全生产职责和执行安全生产法规、政策和标准的情况,依法进行监督、监察、纠正和惩戒。
主要用于风管与部件,如散流器、静压箱、侧送风口等部位的连接方式是( )。
下列选项中属于建设工程竣工验收应当具备的条件的是( )。
属于路基质量检验中石方路基实测项目的有()。
增税使总需求曲线向左移动。
在一些嘈杂的场所,经常看到一些用玻璃制作的电话间,其隔音效果很好,这是因为()。
科学家最新发现被命名为“郑氏晓廷龙”的小恐龙是始祖鸟的“亲戚”,与生存于侏罗纪晚期的始祖鸟亲缘关系非常近。通过分析始祖鸟的形态,并对似鸟恐龙和早期鸟类的系统发育关系进行了重新分析,得出始祖鸟并非鸟类,而是原始的恐爪龙类,即始祖鸟是迅猛龙的祖先,而不是鸟类的
Unlikeothercreatures,whoareshapedlargelybytheir(i)______environment,humanbeingsareproductsofacultureaccumulate
最新回复
(
0
)