首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include void fun( int *s, int n1, int n2 ) { int i,j,t; i=n1; j=n2; while( i
有以下程序 #include void fun( int *s, int n1, int n2 ) { int i,j,t; i=n1; j=n2; while( i
admin
2021-04-28
88
问题
有以下程序
#include
void fun( int *s, int n1, int n2 )
{ int i,j,t;
i=n1; j=n2;
while( i
{ t=*(s+i); *(s+i)=*(s+j); *(s+j)=t;
i++; j--;
}
}
main()
{
int a[10] = { 1,2,3,4,5,6,7,8,9,0} ,i, *p = a;
fun( p,0,3 ); fun( p,4,9 ); fun( p,0,9 );
for( i=0; i<10; i++ )printf("%d ", *( a+i ) );
printf("\n" );
}
程序运行后的输出结果是( )。
选项
A、5 6 7 8 9 0 1 2 3 4
B、0 9 8 7 6 5 4 3 2 1
C、4 3 2 1 0 9 8 7 6 5
D、0 9 8 7 6 5 1 2 3 4
答案
A
解析
转载请注明原文地址:https://kaotiyun.com/show/Txtp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
对于循环队列,下列叙述中正确的是
下列各组排序法中,最坏情况下比较次数相同的是()。
有以下程序#include#includeStructA{inta;charb[10];doublec;};structAf(structAt);main(){
有以下程序#include<stdio.h>#defineN3voidfun(inta[][N],intb[])main(){inti,j;
对于while(!E)s;,若要执行循环体s,则E的取值应为:
若有定义语句:inta=3,b=2,c=1;以下选项中错误的赋值表达式是
若有以下程序段structst{intn;structst*next;};structsta[3]={5,&a[1],7,&a[2],9,’\0’},*p;P=&a[0];则以下选项中值为6的表达式是
有下列程序:#include<stdio.h>voidfun(int*a,intn)/*fun函数的功能是将a所指数组元素从大到小排序*/{intt,i,j;for(i=0;i<n-1;j++)for(j=i+1;j<n;j++)
请编写函数fun,其功能是:将所有大于1小于整数m的非素数存入xx所指数组中,非素数的个数通过k传回。例如,若输入:17,则应输出:46891012141516。注意:部分源程序在文件PROG1.C中。请勿改动主函数main和其他函
以下不能用于描述算法的是
随机试题
毛泽东在探索中国社会主义建设道路过程中提出,社会主义的发展阶段可能分为()
建筑石膏的特性包括()。
监理单位对其验收合格项目的施工质量负()。
金砖四国
目前主要的运营网络有电信网、______和计算机网。
Ifyouintendusinghumorinyourtalktomakepeoplesmile,youmustknowhowtoidentifysharedexperiencesandproblems.Your
In1919Britainexperienceditslargesteverreductioninindustrialworkinghours,to48perweek.InDowie’sviewthe48-hour
1 Peoplehavebeenpaintingpicturesforatleast30,000years.Theearliestpictureswerepaintedbypeoplewhohuntedanimals
It’snouse_______menottoworry.
Underproperconditions,soundwaveswillbereflectedfromahillsideorothersuchobstruction.Soundtravelsattherateofa
最新回复
(
0
)