ysh

杨书蘅 · 发布于 2025-09-11 · 浏览 378 回复 0

include <bits/stdc++.h>

using namespace std; int a[10];

int main() {

long long n;
cin >> n;
while (n != 0) {
	int x = n % 10;
	a[x]++;
	n = n / 10;
}
for (int i = 1; i <= 9; i++) {
	if (a[i] != 0) {
		cout << i;
		a[i]--;
		break;
	}
}
for (int i = 0; i <= 9; i++) {
	if (a[i] != 0) {
		while (a[i]--) {
			cout << i;
		}
	}
}
return 0;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复