[mw_shl_code=c,true]#include <stdio.h>
#include <stdlib.h>
#include <string.h>//错误1:未引入string.h库
int main()
{
char a[101],t;
int len,i,j;
gets(a);
len = strlen(a);//位置错了,先输入再测试长度,另外,strlen拼错啦!
for(i=0; i<=len-2; i++)
{
for(j=1;j<=len-1;j++)
{
if(a<a[j])
{
t=a;
a=a[j];
a[j]=t;
}
}
}
puts(a);
system("pause");
return 0;
}[/mw_shl_code] |