mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 23:11:09 +00:00
Merge pull request #205 from Thejus-Paul/patch-1
Problem Euler Solution Added
This commit is contained in:
commit
990b367bce
14
Project Euler/Problem 9/sol1.py
Normal file
14
Project Euler/Problem 9/sol1.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Program to find the product of a,b,c which are Pythagorean Triplet that satisfice the following:
|
||||
# 1. a < b < c
|
||||
# 2. a**2 + b**2 = c**2
|
||||
# 3. a + b + c = 1000
|
||||
|
||||
print("Please Wait...")
|
||||
for a in range(300):
|
||||
for b in range(400):
|
||||
for c in range(500):
|
||||
if(a < b < c):
|
||||
if((a**2) + (b**2) == (c**2)):
|
||||
if((a+b+c) == 1000):
|
||||
print("Product of",a,"*",b,"*",c,"=",(a*b*c))
|
||||
break
|
Loading…
Reference in New Issue
Block a user