View Code of Problem 77

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,c=0;
	int a[10];
	scanf("%d",&n);
	while(n)
	{
		a[c++]=n%10;
		n=n/10;
	}
	for(i=c-1;i>=0;i--)
	{
		if(i==0)
		printf("%d",a[i]);
		else
		printf("%d ",a[i]);
		
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 77