第1个回答 2013-03-26
#define MAXN = 10000 //数组中最大的数字为10000
//dest为存放单一数字的数组
//src为源数组
//n为数组元素个数
void DeleteCom(int *dest,const int *src,int n)
{
int temp[MAXN];
for(int i =0;i<MAXN;i++)//初始化为0
temp[i] = 0;
for(int i =0;i<n;i++)
temp[src[i]]++;
int j = 0;
for(int i =0;i<MAXN;i++)
if(temp[i] >0)
dest[j++] = i;
}