Consider this code:
#include <stdio.h>
#include <float.h>
int main() {
double a = 100.0;
printf("a: %.6lf\n", a);
return 0;
}
It should print 100.000000 right? It does on https://www.onlinegdb.com/online_c_compiler, it does on my local computer. But on codeforces: https://i.imgur.com/P2CCY7Q.png
I'm more of a Python user so maybe I'm missing something big and it's actually not a bug?
i dont know why but seems
lf
in codeforces is for long double, andf
is for double.I can reproduce. Don't know the exact reason but gcc 5.1 is very old (April 22, 2015), don't use it unless you have a specific reason. For g++6.4 and above look expected.
ah, didn't know you could use g++ for C lol but I guess C++ is a superset of C so it makes sense?