Rebased projecteuler folder, now includes all contest programming stuff

This commit is contained in:
2021-10-26 10:54:24 +02:00
parent 1aa6120838
commit e0c627a384
77 changed files with 203 additions and 67 deletions

28
projecteuler/009/main.py Normal file
View File

@@ -0,0 +1,28 @@
import os
import numpy as np
# Find the pythagorean triplet that sums to 1000
def checkPythTriplet(a, b, c):
return pow(a, 2) + pow(b, 2) == pow(c, 2)
def main():
print("Hello, this is Patrick")
for b in range(500):
for a in range(b):
c = 1000 - b - a
if b < c and checkPythTriplet(a, b, c):
print(a, b, c, a*b*c)
if __name__ == "__main__":
main()