Hacker News new | ask | show | jobs
by _ache_ 193 days ago
Yeah... I come here to talk about that. Should have been

  for i in range(0, 2**8, 2):
      print("    if (number == "+str(i)+")")
      print("        printf(\"even\\n\");")
      print("    if (number == "+str(i + 1)+")")
      print("        printf(\"odd\\n\");")
or

  for i in range(0, 2**8, 2):
      print(f"""    if (number == {i})
          puts("even");
      if (number == {i + 1})
          puts("odd");""")
1 comments

What happens when you try to compute 2**8+1 ?
If its too large you could just subtract 2*8 and try again.
Should work fine with long long?