设该整数m有n位:
1 求出该整数每个位的数字相加组合:
int sum = 0;
sum += m/10^(n-1);
m = m%10^(n-1);
sum += m/10^(n-2);
m = m%10^(n-2);
......
sum += m/10^0;
2 取出该数奇数数位上的数,变成一个新字符串 :
判断n是奇数函数偶数
char *s = (char *)malloc(....);
char *d = (char *)malloc(....);
int i;
int j;
int len;
s = itoa(m);
len = strlen(s);
if(n is odd)
i = 0;
else
i = 1;
for(; i < len; i += 2)
d[i] = s[i];
*d 就是所求字符串.