Codeforces “339A-Helpful Maths” solution( Bangla ) | Cpp language

**Before watching this make sure that you’ve tried enough**

#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int i,j;
    for(i=0; i<s.size(); i+=2)
    {
        for(j=0; j<s.size()-1; j+=2)
        {
            if(s[j]>s[j+2])
            {
                swap(s[j],s[j+2]);
            }
        }
    }
    cout<<s<<endl;
}

 

If this solution helped you, please share this with your friends.
And if you have anything to say, let me know in the comment section.

Leave a Comment