C++ (gcc), (削除) 143 (削除ここまで) 125 bytes
-18 bytes thanks to @ceilingcat
Explanation: it uses the constructor of a class to do the Fibonacci increment operation, and then sets up a variable number of global instances of that class to be initialized before main. The catch being that all those variables have to be named differently, and there's a bit of preprocessor magic needed to get the __LINE__ macro combined into the variable names.
int m,n=1;struct A{A(){m+=n;n=m-n;}};int main(){__builtin_printf("%d",m);}
#define Y(x)A a##x;
#define X(x)Y(x)
X(__LINE__)//
Daniel Schepler
- 1.4k
- 8
- 16