Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
340 B
2
Indexable
#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int a;

    cin >> a;
    int copy_a = a;
    int len_a = 0;
    while (copy_a != 0) {
        copy_a /= 10;
        len_a += 1;
    }

    for (int i = len_a; i != 0; i--) {
        cout << a % 10;
        a /= 10;
        cout << " ";
    }
}