#include <stdio.h>
#include <stdlib.h>
int main()
{
long long int maior, auxm, aux, i, cont, auxc;
for (i=1000000; i>0; i--)
{
aux=i;
cont = 1;
while(aux!=1)
{
if (aux%2==0)
aux = aux/2;
else
aux = 3*aux+1;
cont ++;
}
if (i==1000000)
auxc = cont;
if(cont >= auxc)
{
auxc = cont;
auxm = i;
}
}
printf("\n\nCONT: %lld NUM: %lld\n", auxc, auxm);
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
long long int maior, auxm, aux, i, cont, auxc;
for (i=1000000; i>0; i--)
{
aux=i;
cont = 0;
while(aux!=1)
{
if (aux%2==0)
aux = aux/2;
else
aux = 3*aux+1;
cont ++;
}
if (i==1000000)
auxc = cont;
if(cont >= auxc)
{
auxc = cont;
auxm = i;
}
printf("\n\nCONT: %lld NUM: %lld\n", cont, i);
}
printf("\n\nCONT: %lld NUM: %lld\n", auxc, auxm);
}