在C论坛里看到你回帖的代码中有句看不理解,能详说一下吗
bool ValidateSequence(LinkList * list,int intMaxNumber)
{
int intCount,intarNumbers[100],intPosition;
Link * linkCurrent;
if(!list)
return false;
for(intCount = 0;intCount < intMaxNumber*2;intCount++)
intarNumbers[intCount] = 0;
for(intCount = 0,linkCurrent = list->head;linkCurrent;intCount++,linkCurrent->next)
{
intPosition = intCount;
while(intarNumbers[intPosition] > 0)
intPosition++;
intarNumbers[intPosition] = linkCurrent->intValue;
if(intarNumbers[intPosition+linkCurrent->intValue+1]>0)//这里为什么要+linkCurren->intValue呢
return false;
else if(intPosition+linkCurrent->intValue+1 >= intMaxNumber *2)
return false;
intarNumbers[intPosition+linkCurrent->intValue + 1] = linkCurrent->intValue;
}
for(intCount = 0;intCount < intMaxNumber*2;intCount++)
printf("%d ",intarNumbers[intCount]);
printf("\n");
return true;
}
[求助]myajax95 有空的话,进来帮菜鸟一下,谢谢