-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Helpful_Maths.cpp
More file actions
46 lines (37 loc) · 898 Bytes
/
A_Helpful_Maths.cpp
File metadata and controls
46 lines (37 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <cstring>
using ll= long long;
using ull= unsigned long long;
using lld= long double;
#define GREETINGS_FROM_LOS_POCATOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int main() {
GREETINGS_FROM_LOS_POCATOS
string s;
cin >> s;
int ones = count(s.begin(), s.end(), '1');
int twos = count(s.begin(), s.end(), '2');
int threes = count(s.begin(), s.end(), '3');
string result = "";
for (int i = 0; i < ones; i++) {
result += "1+";
}
for (int i = 0; i < twos; i++) {
result += "2+";
}
for (int i = 0; i < threes; i++) {
result += "3+";
}
result.pop_back();
cout << result << endl;
return 0;
}