TEMA

Wrong anser

szmahmud preguntado 3 years ago

//Why this code showing wong by URI ???

include

int main() { int N,i;

scanf("%d",&N);
for(i=1;i<=N;i++)
{
    double X;
    int count=0,j;
    scanf("%lf",&X);
    while(1)
    {
        if(X/2.0>=1.0)
        {
            X=X/2.0;
            count++;
        }
        else
            break;
    }
    printf("%d dias\n",count+1);
}

}

Recuerda no enviar soluciones. Tu mensaje puede ser revisado por nuestros moderadores.

  • feodorv respondido 3 years ago

    The problem states:

    until left a kg or less

    So

            if(X/2.0>=1.0)

    isn't correct. You can check your solution with the help of uDebug.