3n+1 problem, why is wrong?
    int main(int argc, char *argv[])

    {
      unsigned int i, j, maxCycleLength, currentCycleLength;
      unsigned int n, i_initial;
      int desorden = 1;
      
      maxCycleLength = currentCycleLength = 0;
      i = j = i_initial = 0;
    
      //scanf("%i %i", &i, &j);
    
      while(scanf("%i", &i) != EOF)
      {
        scanf("%i", &j);

        if(i > j)
        {
	  int tmp = i;
	  i = j;
	  j = tmp;
	  desorden = 0;
        }

       n = i;
       i_initial = i;
    
       while(n <= j)
       {
         while(i != 1)
         {
	   if((i%2)==0)
	     i = i/2;
	   else
	     i = 3*i + 1;
	   currentCycleLength++;
         }

      if(i == 1) currentCycleLength++;

      if(maxCycleLength < currentCycleLength)
      {
         maxCycleLength = currentCycleLength;
      }

      currentCycleLength = 0;
      n++;
      i = n;
    }

    if(desorden == 1)
      printf("%i %i %i\n", i_initial, j, maxCycleLength);
    else
      printf("%i %i %i\n", j, i_initial, maxCycleLength);

        maxCycleLength = 0;
       }
    
       return 0;
    }


3n+1 problem, why is wrong?
===

    int main(int argc, char *argv[])

    {
      unsigned int i, j, maxCycleLength, currentCycleLength;
      unsigned int n, i_initial;
      int desorden = 1;
      
      maxCycleLength = currentCycleLength = 0;
      i = j = i_initial = 0;
    
      //scanf("%i %i", &i, &j);
    
      while(scanf("%i", &i) != EOF)
      {
        scanf("%i", &j);

        if(i > j)
        {
	  int tmp = i;
	  i = j;
	  j = tmp;
	  desorden = 0;
        }

       n = i;
       i_initial = i;
    
       while(n <= j)
       {
         while(i != 1)
         {
	   if((i%2)==0)
	     i = i/2;
	   else
	     i = 3*i + 1;
	   currentCycleLength++;
         }

      if(i == 1) currentCycleLength++;

      if(maxCycleLength < currentCycleLength)
      {
         maxCycleLength = currentCycleLength;
      }

      currentCycleLength = 0;
      n++;
      i = n;
    }

    if(desorden == 1)
      printf("%i %i %i\n", i_initial, j, maxCycleLength);
    else
      printf("%i %i %i\n", j, i_initial, maxCycleLength);

        maxCycleLength = 0;
       }
    
       return 0;
    }

