TOPIC

10% WA mas o output é identico ao uDebug?

Vinicius Zamboni Candeu asked 2 years ago

O Output aparentemente esta correto quando uso double mas aparece 10% WA na hora de enviar e por algum motivo ele muda completamente quando uso float (apenas mudando os %lf por %f o codigo passa a apresentar apenas ate I=1.8).

Usando Float:

include include

int main() { float I=0,J=1,a;

for (I=0;I<=2;)
{
    for (a=1;a<=3;)
    {
    if ((I==0.0) || (I==1.0) || (I>1.8))
    {
    printf("I=%.0f J=%.0f\n",I,J);
    J++;
    a++;
    }

    else
    {
    printf("I=%.1f J=%.1f\n",I,J);
    J++;
    a++;
    }
    }
    I+=0.2;
    J-=2.8;
    a=0;
}
return 0;

}

Usando Double

include include

int main() { double I=0,J=1,a;

for (I=0;I<=2;)
{
    for (a=1;a<=3;)
    {
    if ((I==0.0) || (I==1.0) || (I>1.8))
    {
    printf("I=%.0lf J=%.0lf\n",I,J);
    J++;
    a++;
    }

    else
    {
    printf("I=%.1lf J=%.1lf\n",I,J);
    J++;
    a++;
    }
    }
    I+=0.2;
    J-=2.8;
    a=0;
}
return 0;

}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.