samedi 31 octobre 2020

cant increment a variable inside if-statement properly. C++

for(int x=i; x<=j; x++) {
    int reverse = rev(x);
    
    if ((x - reverse)%k == 0)
    {
        days++;
    }  
}

If I include any print statement inside the loop i get the desired output otherwiese it it wrong. I don't want to include print statement.

Aucun commentaire:

Enregistrer un commentaire