Search found 1 match

by kaydara
Mon Jul 19, 2004 3:20 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

i have read and dont find answer for me, i always get Wrong Answer and tryed both ways, code and file:

[c]#include<stdio.h>

int ciclo(int x)
{
int cont=0;
while(1)
{
cont++;
if(x==1) return cont;
else
{
if(x%2==0) x=x/2;
else x=3*x+1;
}
}
return cont;
}


int main()
{
int a,b,i,temp=0 ...

Go to advanced search