Search found 1 match

by daishengqi
Sat Jul 22, 2006 6:46 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320897

help me! 100!

This is my code:

#include <stdio.h>

void main()
{
long i,j,k,n=0,temp,tempn=0;
while (scanf("%ld %ld",&i,&j)!=EOF)
{
if (i>j)
{
temp=i;
i=j;
j=temp;
}

for (k=i;k<=j;k++)
{
temp=k;
while (temp != 1 )
{
if (temp % 2!=0)
{
temp=temp+temp+temp+1;
}
else
{

temp=temp>>1;
}
tempn ...

Go to advanced search