+ 1
Apparently the c compiler is different from another application I have, can anyone tell me what it is? Should I change the code?
Created a code in an app that compiled the lenguage C, and when passed to Sololearn the run is different , and this program is not functional. https://code.sololearn.com/ccHVJ1mSGH1S/?ref=app
12 Réponses
+ 2
I know to use the switch, still so used it this way. The space between the " and the % is in order that remains to a certain distance when printing the code, is not an error.
+ 2
No para nada
+ 2
Lo compilaste ? Pruebalo a ver si te funciona
+ 2
Si en el código falta algún ; es un error a la hora de copiarlo del portapapeles
+ 1
Es bueno saberlo, (lo de los bucles infinitos en sololearn
0
What library you imported ? Sololearn may haven't 1 or more of them
0
This seems wrong to me:
scanf(" %c", &letra);
Why the space before char?
BTW, did you do the lessons on "switch" statement? The long "if" sequence is what we call "code smell".
0
El espacio en el scanf no exije que el usuario tambien lo incluye en la entrada?
0
Solo que tampoco cumple su propósito , en la entrada que se pide no se conserva ese espacio
0
My impression is that the code keep variables values between loops, despite the scanf at the beginning. I don't know why.
0
1_you missed a ; in the last printf() call (in case the input is invalid)
2_Sololearn doesn't support infinite loops as ( trunc ) returns the pointer address of the trunc() function of math which evaluates to true, to test your program i had to use : do {...} while(false);
0
I ran in code playground itself.
But VCoder answer reminded me of another thing the code playground doesn't support: input loops. It can only take all inputs at once, in the beginning of the execution.
So, in code playground, you have to remove the loop, or use Vcoder's trick to limit it to a single run.