#include
#include
void fun(char s[])
{int i,j,n;
char c;
for(i=0;ifor(j=0;j if(s[j]>s[j+1])
{c=s[j];s[j]=s[j+1];s[j+1]=c;}
}
int main()
{char s[30];
gets(s);
fun(s);
printf("%s\n",s);
return 0;
}
#include
#include
void fun(int d,char a[])
{
int i,j;
char t;
for(i=0;i
for(j=0;j
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
for(i=0;i
printf("%c\n",a[d-1]);
}
int main()
{
char a[20];
int d;
scanf("%s",a);
d=strlen(a);//求字符串的长度
fun(d,a);
return 0;
}
VC++6.0