首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> #include<string_h> voidfun(char*W,intm) {chars,*p1,*p2; p1=w;p2=w+m-1; while(pl<p2){s=*p1;*p1=*p2;*p2=s;
有以下程序 #include<stdio.h> #include<string_h> voidfun(char*W,intm) {chars,*p1,*p2; p1=w;p2=w+m-1; while(pl<p2){s=*p1;*p1=*p2;*p2=s;
admin
2020-11-23
22
问题
有以下程序
#include<stdio.h>
#include<string_h>
voidfun(char*W,intm)
{chars,*p1,*p2;
p1=w;p2=w+m-1;
while(pl<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2-;}
}
main( )
{1chara[]=“123456“;
fun(a,strlen(a));puts(a);
}
选项
A、116611
B、161616
C、65432l
D、123456
答案
C
解析
函数fun的功能是将字符串w中的元素从大到小进行排列,所以在主函数中调用函数fun后,字符串a的元素从大到小进行了排列。
转载请注明原文地址:https://kaotiyun.com/show/Pc3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列给定程序中,函数fun的功能是:依次取出字符串中所有的数字字符,形成新的字符串,并取代原字符串。请改正函数fun中的错误,使它能得出正确的结果。注意:不得增行或删行,也不得更改程序的结构!试题程序:#include<stdlib.h>#inc
下列给定程序中,函数fun的功能是:在形参ss所指字符串数组中查找与形参t所指字符串相同的串,找到后返回该串在字符串数组中的位置(即下标值),若未找到则返回—1。ss所指字符串数组中共有N个内容不同的字符串,且串长小于M。请在下画线处填入正确的内容并将下
下列给定程序中,函数fun的功能是:输出M×M整数方阵,然后求两条对角线上元素之和,并作为函数值返回。请改正程序中的错误,使它能得出正确的结果。注意:不得增行或删行,也不得更改程序的结构!试题程序:#include<stdio.h>#defin
给定程序中,函数fun的功能是:调用随机函数产生20个互不相同的整数放在形参a所指数组中(此数组在主函数中已置0)。请在程序的下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。注意:不得增行或删行,也不得更改程序的结构!试题程序:#inc
有以下程序:#include<stdio.h>voidmain(){chara,b,c,d;scanf(″%c%c″,&a,&b);c=getchar();d=getchar();printf(″%c%c%c%C\n″,a,b,c
下列叙述中错误的是()。
以下叙述中错误的是()。
一名教师可讲授多门课程,一门课程可由多名教师讲授。则实体教师和课程间的联系是()。
公司中有多个部门和多名职员,每个职员只能属于一个部门,一个部门可以有多名职员。则实体部门和职员间的联系是()。
在软件开发中,下面不属于设计阶段的任务的是()。
随机试题
月经量少,点滴即净,色淡无块,伴头晕眼花,心悸怔忡,舌淡脉细,首选方是:
用SPF鸡胚分离新城疫病毒时,病料接种的部位是
在同一总体中随机抽取多个样本,用样本来估计总体均数的95%可信区间,则估计精确的是
下列药物的抗菌机制为抑制细菌蛋白质合成的是()。
妄想是指()
(2005年)已知空气的密度ρ为1.205kg/m3,动力黏度(动力黏滞系数)μ为1.83×10-5Pa.s,那么它的运动黏度(运动黏滞系数)v为()。
政府采购的运行机制有( )。
除紧急情况外,人身检查必须经()批准。
在传统的中国式家庭里,家长说一不二,强行决定孩子应该怎么样,不能怎么样。现在的孩子不用下跪了,但在家庭生活中我们有没有做到最基本的民主呢?比方说涉及孩子利益的事情,家长有没有征求过孩子的意见?当家庭内部出现争执的时候,无论有没有道理,家长总是习惯于用简单粗
下面给出的4种排序方法中,()排序法是不稳定性排序法。
最新回复
(
0
)