We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0cb0ec commit 19bcba5Copy full SHA for 19bcba5
339A - Helpful Maths.cpp
@@ -0,0 +1,25 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+// Code Written By: Vikash Patel
5
6
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
7
8
+int main()
9
+{
10
+ string s;
11
+ cin>>s;
12
+ sort(s.begin(),s.end());
13
+ string ans;
14
+ int n=s.size();
15
+ for(int i=n/2;i<n-1;i++)
16
+ {
17
+ if(s[i]!='+')
18
19
+ ans+=s[i];
20
+ ans+='+';
21
+ }
22
23
+ ans+=s[n-1];
24
+ cout<<ans<<endl;
25
+}
0 commit comments