大家好,又见面了,我是全栈君。
源程序:
#include<iostream>
#include<string>
using namespace std;
//const int max=1024;
int main()
{
char s[1024];
char temp;
gets(s);
int len;
len=strlen(s);
for(int i=0;i<len;i++)
{
for(int j=i+1;j<len;j++)
{
if(s[i]>s[j])
{
temp=s[i];s[i]=s[j];s[j]=temp;
}
}
}
puts(s);
return 0;
}
执行结果:
总结:非常easy~0基地称号~
版权声明:本文博客原创文章,博客,未经同意,不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117396.html原文链接:https://javaforall.cn