函数题:按要求移动字符
函数Move_str的功能是:在字符串str中找到ASCII码值最大的字符,将该字符放到首位,其余字符顺序后移。
### 函数接口定义:
c++
void Move_str ( char *p);
其中 p 是用户传入的参数。
### 裁判测试程序样例:
c++
#include<stdio.h>
void Move_str ( char *p);
int main()
{
char str[80];
gets(str);
Move_str(str);
printf("The string after moving:");
puts(str);
return 0;
}
/* 请在这里填写答案 */
### 输入样例1:
in
ABCDeFG
### 输出样例1:
out
The string after moving:eABCDFG
### 输入样例2:
in
ABCDeFGe
### 输出样例2:
out
The string after moving:eeABCDFG
答案:若无答案欢迎评论
### 函数接口定义:
c++
void Move_str ( char *p);
其中 p 是用户传入的参数。
### 裁判测试程序样例:
c++
#include<stdio.h>
void Move_str ( char *p);
int main()
{
char str[80];
gets(str);
Move_str(str);
printf("The string after moving:");
puts(str);
return 0;
}
/* 请在这里填写答案 */
### 输入样例1:
in
ABCDeFG
### 输出样例1:
out
The string after moving:eABCDFG
### 输入样例2:
in
ABCDeFGe
### 输出样例2:
out
The string after moving:eeABCDFG
答案:若无答案欢迎评论