Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
532 B
3
Indexable
Never

#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
    string a,a1,a2,a3;
    string q = {'1','2','3','4','5','6','7','8','9','0'}
    int i, b, s, w;
    cin >> a;
    for(i = 0;i<a.size();i++){
        s = 0;
        for(j = 0;j<10;j++) {
            if (a[i] == q[j]){
                s = 1;
                a2+=a[i];
            }
        if (s == 0) a1 += a[i];
    
        }
    }
    cout << a1;
    for(w = a2.size()-1;w>0;w--){
        a3 += a2[w];
    }
    cout << a3;
        
}