#include<stdio.h>
int recursive_activity_select(int * s,int *f,int k,int n);
int main(void)
{ int s[12]={0,1,3,0,5,3,5,6,8,8,2,12};
int f[12]={0,4,5,6,7,9,9,10,11,12,14,16};
recursive_activity_select(s,f,0,11);
putchar('\n');
}
/* 递归调用所有函数的返回值都是1*/
int recursive_activity_select(int * s,int *f,int k,int n)
{ int m=k+1;
while(m<=n && s[m]<f[k])
m++;
if(m<=n)
{ printf(" a%d ",m);
return recursive_activity_select(s,f,m,n);
}
else
return 1;
}