标签:
typedef enum { FALSE = 0, TRUE = 1 }BOOL; #define N 10 BOOL bTest(void); int main() { BOOL r; while(1) { r = bTest(); printf("%d\n",r); } } BOOL bTest(void) { long int date; int aBuf[N]; int i = 0; int j = 0; printf("input the date:\n"); scanf(" %d",&date); if(date < 10) { return TRUE; } while(date) { aBuf[i++] = date%10; date /= 10; } while(j < (i+1)/2) { if(aBuf[j] != aBuf[i - 1 -j]) { return FALSE; } j++; } return TRUE; }
标签:
原文地址:http://www.cnblogs.com/aprilapril/p/5406465.html