5 ms·
#include <stdio.h> #include <stdlib.h> void main(int j) { printf("%d\n", j); (main + (exit - main)*(j/1000))(++j); } Somehow the solutions that
by wbhart 16y ago
#include <stdio.h>
#include <stdlib.h>
void main(int j) {
printf("%d\n", j);
(main + (exit - main)*(j/1000))(++j);
}
Somehow the solutions that crash on exit are cheating too much. The above doesn't (obviously) compile to something which uses conditionals at the assembly level. This solution probably wouldn't be by the book. That takes a few more lines of code.