Skip to content

Commit 19bcba5

Browse files
committed
Added 339A - Helpful Maths.cpp
1 parent a0cb0ec commit 19bcba5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

339A - Helpful Maths.cpp

+25
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)