#include <stdio.h>
int main(){
char str[80], *p, max, *q;
p=str;
gets(p);
max=*(p++);
while(*p != '\0')
{ if(max<*p){
max=*p;
q=p;}
p++;
}
p=q;
while( p>&str[0])
{ *p=*(p-1);
p--; }
*p=max;
puts(p);
return 0;
}
字符串str中找出最大的字符并放在第一个位置上,并将将字符前的原字符往后顺序移动。
猜你喜欢
转载自blog.csdn.net/KEVINzzh/article/details/103794936
今日推荐
周排行