复制代码 代码如下:
char finalPathSet[256][256];
char middlePathSet[256][256];
int finalSetSize=0;
int middleSetSize=0;
int addToPathSet(char path[]){
strcpy(middlePathSet[middleSetSize],path);
middleSetSize++;
}
int meetPathSet(){
char tempPathSet[256][256];
int tempSetSize=0;
int i,j;
if(finalSetSize==0){
for(i=0;i
strcpy(finalPathSet[i],middlePathSet[i]);
}
finalSetSize=middleSetSize;
}
else{
for(i=0;i
for(j=0;j
if(strcmp(finalPathSet[i],middlePathSet[j])==0){
strcpy(tempPathSet[tempSetSize],finalPathSet[i]);
tempSetSize++;
}
}
}
for(i=0;i
strcpy(finalPathSet[i],tempPathSet[i]);
}
finalSetSize=tempSetSize;
}
}