用递归实现:long reverse(long a){ printf ("%d",a%10); if (a>10) reverse(a/10);}大家可以试一下。
#include <stdio.h>
void main(){ int i,num,temp;
printf("Please enter five bit number:"); scanf("%d",&num); if(num<0) { printf("Number is error!"); } else while(num) { temp=num%10; num/=10; printf("%d",temp); } printf("\n");}这个程序有功能不管你要几位都可以求