07/05/15 23:06:40
>>99
こんな感じかなぁ(あんまり再帰を使ってないけど)。
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define NMAX (INT_MAX / 2)
struct P {
int sum;
union {
struct P *p[2];
int n;
} as;
};
int Count(struct P *p, int n)
{
return (p->sum != 1) ? (Count(p->as.p[0], n) + Count(p->as.p[1], n)) : (p->as.n == n);
}