呵呵,这两道题相差不大:
/* ID: qq104801 LANG: C++ TASK: dualpal */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> /* for debug only:counter */ void debug_dummy(void) { return; } int n,s; char x[32]; char num[]={'0','1','2','3','4','5','6','7','8','9'}; void xnum(int a,int b) { int i=0; int c=a; while(c!=0) { x[i]=num[c%b]; c=c/b; i++; } x[i]='