1. 程式人生 > >洛谷 SPOJ 題解 SP1 【TEST - Life, the Universe, and Everything】

洛谷 SPOJ 題解 SP1 【TEST - Life, the Universe, and Everything】

給出一種主函式遞迴的方法(其實主函式 main() 也是可以遞迴的)

#include <stdio.h>

int main()
{
    int a;
    scanf("%d", &a);
    if (a != 42) {
        printf("%d\n", a);
        main();
    }
    return 0;
}