题解 | #图片整理#

图片整理

http://www.nowcoder.com/practice/2de4127fda5e46858aa85d254af43941

#include <string.h>

int main()
{
    int i,j;
    char str[1026]={0},temp;
    scanf("%s",str);
    for(i=0;i<strlen(str);i++)
    {
        for(j=i+1;j<strlen(str);j++)
            if(str[i]>str[j])
            {
                temp=str[i];
                str[i]=str[j];
                str[j]=temp;
            }
    }
    printf("%s", str);
    
}
全部评论

相关推荐

点赞 评论 收藏
转发
1 1 评论
分享
牛客网
牛客企业服务