洛谷 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;
}

猜你喜欢

转载自www.cnblogs.com/hkxadpall/p/9895983.html
SP1
今日推荐