with open("./ifs.c", mode='w') as file:
    num = 100000
    file.write("int comp(int x) {\n    if (x == 0) {\n        return 0;\n    } ")
    for i in range(1,num-1):
        s = f"else if (x == {i}) {{\n        return {i};\n    }} "
        file.write(s)
    file.write(f"else {{\n        return {num-1};\n    }}\n}}")
    file.write(f"\n\nint main(void) {{\n    for (int i = 0; i < {num}; i++) {{        \n        comp(i);\n    }}\n    return 0;\n}}\n")
