![](https://cos-cdn.shuashuati.com/pipixue-wap/2020-1230-1107-56/ti_inject-812ce.png)
下列给定,函数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'); }