View Code of Problem 77

#include <stdio.h>
#include <string.h>
char output(int x){
	int t,i;
	char str[4];
	for(i = 0;;i++){
		t = x%10;
		str[i] = t+48;
		if(x == 0 )
			break;
		x = x/10;
	}
	for(i = 3;i>=0;i--)
		printf("%c ",str[i]);
	return 0;
}
main(){
	int n;
	scanf("%d",&n);
	output(n);
	return 0;
}

Double click to view unformatted code.


Back to problem 77