C language - the output interval

1035: C language - the output gap
topic describes
write a function, enter a four-digit number, the required output of these four numeric characters, but spaces between every two numbers. 1990 as input, the output should be "1990."

Enter
a four-digit
output
increase in output space
sample input
1990
Sample Output
1990

# include<stdio.h>
int main()
{
	int a,x[100],i=0,j;
	scanf("%d",&a);
	while(a>0)
	{
		x[i]=a%10;
		a/=10;
		i++;
	}
	for(j=i-1;j>=0;j--)
	{
		printf("%d ",x[j]); 
	}
	return 0;
}
Published 123 original articles · won praise 8 · views 20000 +

Guess you like

Origin blog.csdn.net/Du798566/article/details/104888758