#include <stdio.h>
#include <string.h>
int main(void)
{
char a[1024];
int i,num,len,j;
char temp;
gets(a);
len=strlen(a);
for(i=len-1;i>1;i--)
{
for (int j = 0; j<i; ++j)
{
/* code */
if (a[j]>a[j+1])
{
/* code */
temp = a[j+1];
a[j+1] = a[j];
a[j] = temp;
}
}
}
puts(a);
return 0;
}
华为测试题图片排序(简单的冒泡排序)
最新推荐文章于 2024-08-02 19:19:35 发布