-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8.py
25 lines (24 loc) · 1.46 KB
/
8.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#Problema 8. Trobar el producte més gran possible d'un llista de números
cadena = "731671765313306249192251196744265747423553491949349698352031277" \
"4506326239578318016984801869478851843858615607891129494954595017" \
"37958331952853208805511125406987471585238630507156932909632952274" \
"43043557668966489504452445231617318564030987111217223831136222989" \
"342338030813533627661428280644448664523874930358907296290491560440772" \
"39071381051585930796086670172427121883998797908792274921901699720888093776" \
"657273330010533678812202354218097512545405947522435258490771167055601360" \
"4839586446706324415722155397536978179778461740649551492908625693219784686224" \
"828397224137565705605749026140797296865241453510047482166370484403199890008895" \
"2434506585412275886668811642717147992444292823086346567481391912316282458617866458" \
"359124566529476545682848912883142607690042242190226710556263211111093705442175069416" \
"58960408071984038509624554443629812309878799272442849091888458015616609791913387" \
"54992005240636899125607176060588611646710940507754100225698315520005593572972571636269" \
"561882670428252483600823257530420752963450"
res_max = 0
adjacentNumbers = 13
for i in range(len(cadena) - adjacentNumbers):
res = 1
for j in range(adjacentNumbers):
res *= int(cadena[i+j])
if res > res_max:
res_max = res
print(res_max)