题解 | #图片整理#
图片整理
https://www.nowcoder.com/practice/2de4127fda5e46858aa85d254af43941
#include <stdio.h> #include <string.h> int main() { char str[1000] = {0}; scanf("%s",str); int le = strlen(str); char tmp; for(int i = 0; i < le; i++) { for(int j = i+1; j < le; j++) { if(str[i] > str[j]) { tmp = str[i]; str[i] = str[j]; str[j] = tmp; } } } printf("%s",str); return 0; }