首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的运行结果是( )。 #inc1ude void fun (int*s,int*p) {static int t=3; *p=s[t]; t一一: } void main() {
下列程序的运行结果是( )。 #inc1ude void fun (int*s,int*p) {static int t=3; *p=s[t]; t一一: } void main() {
admin
2021-06-15
25
问题
下列程序的运行结果是( )。
#inc1ude
void fun (int*s,int*p)
{static int t=3;
*p=s[t];
t一一:
}
void main()
{ int a[]={2,3,4,5},k,x;
for(k=0;k<4;k++)
{ fun(a,&x);
printf("%d,",x);
}
}
选项
A、5,4,3,2,
B、2,3,4,5,
C、2,2,2,2,
D、5,5,5,5,
答案
A
解析
分析fun函数程序段,可知fun函数要实现的功能是将s中第(t+1)个元素以前的元素逆置赋给数组p。由于fun函数定义了静态变量t=3,因此,在主函数中调用函数fun(a,&x)时,就是要将数组a中前4个元素逆置赋给数组x,最后输出x数组。
转载请注明原文地址:https://jikaoti.com/ti/Zlz0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下叙述中正确的是
有下列程序:voidf(int*q){inti=0;for(;i<5;i++)(*q)++;}main(){inta[5]={1,2,3,4,5},i;f(a);for(i=0;i<5;i++)printf(
设有定义语句int(*f)(int);则以下叙述正确的是
下列条件语句中,输出结果与其他语句不同的是
以下叙述中正确的是
设R是一个2元关系,有3个元组,S是一个3元关系,有3个元组。如T=R×S,则T的元组的个数为()。
以下选项中函数形参不是指针的是
下面不属于需求分析阶段任务的是
软件生命周期中的活动不包括()。
随机试题
电动压力调节器开度突然变大的原因可能是()。
有"夏月之麻黄"之称的药物是
骨折近端向后倾斜移位骨折远端向后倾斜移位
慢性呼吸衰竭最常见的酸碱失衡是
对建筑物的基本要求是安全、适用、经济、美观,下列对建筑物的要求中,属于适用方面的要求是()。
由于职业判断贯穿于注册会计师审计工作的全过程,并且可能得到的审计证据有很多是说服性而非结论性的,因此,注册会计师的任何审计意见都不能绝对保证会计报表使用人确定已审计会计报表的可靠程度。 ( )
简要回答幼儿成长档案袋评价的含义及基本内容。
行政主体就是行政法律关系主体。()
某温泉旅游胜地村委会主任选举时,温泉度假村总经理姜某许诺给他投票的选民可以获赠温泉度假村门票10张,并为谋求镇政府支持送给镇长温泉度假村VIP钻石卡一张(价值10万元)。对于姜某的行为说法正确的是()
2017年11月25日,甲(2003年11月26日出生)在公共汽车上将手伸进丙的衣袋偷东西,丙发现后立即抓住甲的手。甲的同伙乙(2000年12月5日出生)见状拔出甲随身携带的匕首刺向丙胸部。丙情急之下拉过乘客陈某的胳膊挡在自己前面,乙刺中陈某胳膊,致其轻伤
最新回复
(
0
)