#include<bits/stdc++.h> using namespace std; int main() { int n, arr[5],count=0; cin>>n; while(n) { arr[count++]=n%10; n/=10; } for(int i=3; i>=0; i--) cout<<arr[i]<<" "; }
Double click to view unformatted code.