怎么修改divide error的错误
吃鱼爱挑刺 2019-12-29 11:50:58 (一个函数内的错误)
在链表中查找包含指定数字的节点,找到则返回,无则返回0,将所有数据输出t43
int Search_LList(struct number*head,int number)
{ struct number*p1;
int count=0,i=0,j=0,m;
long int ti;
p1=head;
ti=number;
for(;ti;ti/=10) /*j shi number shu*/
j++;
while(p1!=0)
{
ti=p1->x; /*the first step is to find weishu*/
for(;ti;ti/=10)/* i shi jiedian shu */
i++;
if(i<j)
{
p1=p1->next;
continue;
}
ti=p1->x;
for(m=0;m<=(i-j);m++)/*pan duan gai shu shibushi*/
{
if(ti%(long int)pow(10,m+j)-ti%(long int)pow(10,m)==(long int)number*pow(10,m))
printf("%ld,",ti),count++;
break;
}
p1=p1->next;
}
return count;
}