怎么修改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;   }
...全文
251 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
吃鱼爱挑刺 2019-12-29
  • 打赏
  • 举报
回复
具体思路是 举个例子:该节点数是34658,number是46 那我就想判断58==46? 不行就判断65==46? 46==46? 是就下一个节点
吃鱼爱挑刺 2019-12-29
  • 打赏
  • 举报
回复
head是链表的头指针,number是指定数字

69,364

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧