# include "stdio.h"
# include "stdlib.h"
# include "iostream.h"
# include "malloc.h"
# include "string.h"
// # include "mem.h"
//半数集问题
long comp(int n);
/*
//(1) 一般算法,但低效
void main()
{
int n;
printf("------------");
printf("\n半数集问题\n");
printf("------------\n");
printf("输入一自然数");
scanf("%d",&n);
printf("\n半数集个数为%d\n",comp(n));
}
long comp (int n)
{
long ans=1;
if(n>1)
for (int
i=1;i<=n/2;i++)
ans+=comp(i);
return
(ans);
}