九九表を出力するプログラム


なんか流行ってるみたいなので便乗してみました。

9x9.c
#include <stdio.h>
#if __INCLUDE_LEVEL__ == 0
    int main(void) {printf(
#else
    #define n (((__INCLUDE_LEVEL__ - 1) / 9 + 1) * ((__INCLUDE_LEVEL__ - 1) % 9 + 1))
#if n / 10 == 0
    " "
#elif n / 10 == 1
    "1"
#elif n / 10 == 2
    "2"
#elif n / 10 == 3
    "3"
#elif n / 10 == 4
    "4"
#elif n / 10 == 5
    "5"
#elif n / 10 == 6
    "6"
#elif n / 10 == 7
    "7"
#else
    "8"
#endif
#if n % 10 == 0
    "0"
#elif n % 10 == 1
    "1"
#elif n % 10 == 2
    "2"
#elif n % 10 == 3
    "3"
#elif n % 10 == 4
    "4"
#elif n % 10 == 5
    "5"
#elif n % 10 == 6
    "6"
#elif n % 10 == 7
    "7"
#elif n % 10 == 8
    "8"
#else
    "9"
#endif
#if __INCLUDE_LEVEL__ % 9
    " "
#else
    "\n"
#endif
#endif
#if __INCLUDE_LEVEL__ < 9 * 9
    #include __FILE__
#endif
#if __INCLUDE_LEVEL__ == 0
    );}
#endif

実行結果です。

プリプロセスとアセンブラ出力
https://godbolt.org/z/tEozra