`
诗意的栖居
  • 浏览: 274475 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

No.8 The greatest product of five consecutive digits in the 1000-digit numb

 
阅读更多
Q:
Find the greatest product of five consecutive digits in the 1000-digit number.

73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
53697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474
82166370484403199890008895243450658541227588666881
16427171479924442928230863465674813919123162824586
17866458359124566529476545682848912883142607690042
24219022671055626321111109370544217506941658960408
07198403850962455444362981230987879927244284909188
84580156166097919133875499200524063689912560717606
05886116467109405077541002256983155200055935729725
71636269561882670428252483600823257530420752963450

A:

string = 'long string'

l = list(string)
great = 0

for i in range(0,len(l)-5):
    num = 1
    for j in range(i,i+5):
        num *= int(l[j])
        if great < num:
            great = num

print great
分享到:
评论

相关推荐

    博士研究生英语精读-翻译与原文(中科院).doc

    Michelson, famous for his work on the measurement of the speed of light, stated: "The more the universe seems comprehensible, the more it also seems pointless." This suggests that the pursuit of ...

    Theory of Point Estimation.pdf

    The greatest change has been the addition to the sparse treatment of Bayesianinference in the first edition. This includes the addition of new sections onEquivariant, Hierarchical, and Empirical ...

    Earth.3of3.Romans

    BBC.Ancient.Greece.The.Greatest.Show.on.Earth.3of3.Romans.HDTV.x264.AAC.MVGroup.org.mkv.td.cfg

    JavaScript: The Good Parts

    Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined. This authoritative ...

    Diskeeper 2008 v12.0.759.0

    and overall health of your volumes in the Dashboard tab. This information allows you to be more proactive in the management and maintenance of your computers. I-FAAST[R] (Intelligent File Access ...

    雷达技术知识

    partial fulfillment of the requirements for the Master of Science degree in the Department of Geography. This thesis has been approved and accepted by: Date Committee in Charge: W. Andrew Marcus, ...

    Self-Help

    But the greatest tailor of all is unquestionably Andrew Johnson, the present President of the United States--a man of extraordinary force of character and vigour of intellect. In his great speech at ...

    Yunus, Muhammad - Creating A World Without Poverty; Social Business and the Future of Capitalism

    It reveals the next phase in a hopeful economic and social revolution that is already under way—and in the worldwide effort to eliminate poverty by unleashing the productive energy of every human ...

    微软内部资料-SQL性能优化2

    The main advantage of running in-process is that the system usually does not need to perform a context switch. The disadvantage to running in-process is that DLL has access to the process address ...

    Handbook of Research on Soft Computing and Nature-Inspired Algorithms

    Itcausestoolwearresultinginlossofqualityoftheproduct.Non-conventional machining,ontheotherhandproducesproductwithminimumtimeandatdesiredlevelof...

    hibernate-shards.jar

    on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may ...

    [离散数学及其应用(英文第六版)].Discrete.Mathematics.and.its.Applications.djvu

    经典教材Contents Preface vii The MathZone Companion Website xviii To the Student xx 1 The Foundations: Logic and Proofs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 ...

    CSP-J No.1模拟题附答案

    根据给定的信息,我们可以从标题、描述以及部分内容中提取出一系列与CSP-J No.1模拟题相关的知识点。下面是对这些知识点的详细说明: ### 1. 电子邮件相关的网络协议 - **知识点**:理解电子邮件通信过程中涉及的...

    Universal-USB-Installer

    under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-...

    New-folder-(4).rar_The Common

    Both plaintext m and ciphertext c should be in the set of nonnegative integers. Furthermore, before encrypting a plaintext message m, we need to make sure that 0 &lt;= m &lt; n. If m is greater than...

Global site tag (gtag.js) - Google Analytics