当前位置: 代码迷 >> 综合 >> A. Helpful Maths
  详细解决方案

A. Helpful Maths

热度:1   发布时间:2024-02-08 15:39:46.0

A. Helpful Maths

原题传送门

代码

#include <bits/stdc++.h>
using namespace std;const int maxn = 1e5 + 10;
int a[maxn];
int main() {ios::sync_with_stdio(false);char c;int n = 0;while (cin >> c) {if (c == '+') continue;a[n] = c - 48;n++;}sort(a, a + n);cout << a[0];for (int i = 1; i < n; i++) cout << "+" << a[i];cout << endl;return 0;
}