皮皮学,免费搜题
登录
搜题
【简答题】
下列给定,函数fun()的功能是:在字符串str中找出ASCII码值最大的字符,将其放在第一个位置上,并将该字符前的原字符向后顺序移动。例如,调用fun()函数之前给字符串输入ABCDeFGH,调用后字符串中的内容为 eABCDFGH。 请改正的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。 试题程序: include<stdio.h> /***************found************/ fun(char *p) { char max, *q;int i=0; max=p[i]; while (p[i]!=0) {if (max<p[i]) { /***************found************/ p = q +i;max=p[i]; } i++; } /***************found************/ while (q<p) {*q=*(q-1); q--; } p[0]=max; } main() { char str[80]; printf('Enter a string: '); gets(str); printf('/nThe original string: '); puts(str); fun(str); printf('/nThe string after moving: '); puts(str); printf('/n/n'); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【简答题】ardent
【简答题】She is an ardent lover of western classic music.
【判断题】When Darcy first proposes to Elizabeth, he is ardent and humble.
A.
正确
B.
错误
【单选题】This song ________ his life's dream and ardent love of life.
A.
incorporated
B.
initiated
C.
exposed
D.
embodied
【单选题】急性胰腺炎急性反应期的时间窗为
A.
发病至4周
B.
6 周至8周
C.
2 周至4周
D.
发病至2周
【简答题】ardent
【单选题】Michael is an ardent supporter of his presidential candidate. That became obvious to me when I found out how much time he’s donated to the campaign. Perhaps Michael knows what he’s doing.What does “ar...
A.
old
B.
intelligent
C.
foolish
D.
very strong
【单选题】ardent
A.
热情的;多情的
B.
贪婪的
C.
商品
D.
不适应环境的人,与他人不同的人
【简答题】ardent, often selfless affection and dedication d( )
【简答题】ardent life s________ _