Skip to content

Commit a8ca808

Browse files
committed
Helpful Maths
1 parent a7fd066 commit a8ca808

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

339A.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include<iostream>
2+
#include<string>
3+
#include<algorithm>
4+
using namespace std;
5+
6+
int main(){
7+
string s1;
8+
cin>>s1;
9+
char arr[s1.size()-1];
10+
int j = 0;
11+
for(int i = 0; i < s1.size(); i += 2){
12+
arr[j]= s1[i];
13+
j++;
14+
}
15+
sort(arr, arr+j);
16+
for(int k = 0; k < j; k++){
17+
if(k == j-1){
18+
cout<<arr[k];
19+
}
20+
else{
21+
cout<<arr[k]<<"+";
22+
23+
}
24+
}
25+
26+
return 0;
27+
}

0 commit comments

Comments
 (0)