View Code of Problem 54

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n;
	cin>>n;
	int a[100] = { },op = 0,t;
	while(n){
		t = n % 10;
		a[op++] = t;	
		n/=10;
	}
	
	for(int i = op - 1;i >= 0;i--){
		cout<<a[i];
		if(i!=0)cout<<" ";
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 54