处理回文,可dp
#include <stdio.h>
#include <string.h>
__int64 num[300][300];
int main()
{
memset(num, 0, sizeof(num));
int i, j;
for ( i = 0; i < 300; i++ )
{
num[0][i]= 1;
for ( j = i ; j >= 0 ; j--)
num[i][j]= 1;
}
for ( i = 2 ; i < 300 ; i++ )
for ( j = i/2; j > 0; j-- )
num[i][j]= num[i-2*j][j]+num[i][j+1];
int n;
while ( scanf("%d", &n), n)
{
printf("%d %I64d\n", n, num[n][1]);
}
return 0;
}