View Code of Problem 54

#include<cstdio>
#include<vector>
using namespace std;
typedef long long ll;
int main(){
	ll n;
	vector<int> vt;
	scanf("%ld",&n);
	while(n){
		vt.push_back(n%10);
		n=n/10;
	}
	for(int i=vt.size()-1;i>=0;i--){
		if(i>0)	printf("%d ",vt[i]);
		else	printf("%d",vt[i]);
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 54