Search found 1 match

by Black Hat
Fri Jun 03, 2011 10:11 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320000

Re: If you get WA in problem 100, read me before post!

Would you tell me please whats wrong in this code? I got WA. :(

#include<stdio.h>

int main()
{
int i,j,n,I,J,cycle,x,y;
while((scanf("%d %d",&i,&j))!=EOF)
{
x=i;
y=j;
if(i>j)
{
y=i;x=j;
}
cycle=0;
for(I=x;I<=y;I++)
{
n=I;
for(J=1;n!=1;J++)
{
if(n%2==0) n/=2;
else n=(3*n)+1 ...

Go to advanced search