KnightCTF 2022

Keep Calculating – Programming Challenge Writeup | KnightCTF 2022

Based on the challenge coded the script below,

def main():
    x = 1
    y = 2
    answer = 0

    while x <= 666:
        # Perform the calculation
        answer += (x  y) + int(f"{x}{y}")
        
        # Increment x for the next iteration
        x += 1
    
    # Print the final answer in the flag format
    print(f"KCTF{{{answer}}}")

if name == "main":
    main()

0 people love this