Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
562 B
0
Indexable
Never
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
    string a, a1, a2, a3;
    string q = "1234567890";
    int i, b, s, w;
    cin >> a;
    for (i = 0; i < a.size(); i++) {
        s = 0;
        for (int j = 0; j < 10; j++) {
            if (a[i] == q[j]) {
                s = 1;
                a2 += a[i];
            }
        }
        if (s == 0) a1 += a[i];

        }
    cout << a1 << "\n";
    for (w = a2.size() - 1; w > -1; w--) {
        a3 += a2[w];
    }
    cout << a3;

}