帮我看看一道简单的C语言题为什么run time error

来源:百度知道 编辑:UC知道 时间:2024/06/07 12:46:53
#include<stdio.h>
#include<math.h>
#include<string.h>
#include <ctype.h>
int f(int n)
{
int sum=1;
while(n!=1)
{

if(n%2==0)
{
sum++;
n=n/2;
continue;
}
else
{
sum++;
n=3*n+1;
continue;
}
}
return sum;
}

void main()
{
int x,t,n,m,i,sum;
int a[1000000];
while(scanf("%d %d",&n,&m)!=EOF)
{
t=n;
for(i=n;i<=m;i++)
{
a[i]=f(i);
if(a[t]<a[i])
t=i;
}
printf("%d %d %d\n",n,m,a[t]);
}
}

我的代码
摆渡杀连接的。我等会补充
一道c语言的题,帮我看看~~~ 大家帮我看看这个简单的C语言问题 帮我看看这个简单的C语言问题 一道C语言编程 各位大哥大姐帮我看看 请帮我讲一道C语言编程的题,对于您这相当简单!急!! 关于C语言的一道选择题,大家帮我看看好吗? C语言:帮我看看这不超过20行的简单程序... ... 一道简单的C语言问题,会C的都进来看看 一道简单的C语言编程题,谁能帮我解解? 一道简单的C语言问题